summaryrefslogtreecommitdiffstats
path: root/lib/log.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib/log: add [defer ] groupVladimír Čunát2024-10-011-0/+1
| | | | In particular this turns off those debug logs by default.
* Merge 'origin/master' into 6.0 - last merge before renameOto Šťáva2024-05-141-1/+1
|\ | | | | | | | | This is the last commit in `6.0` before it is shifted into `master`, with 5.x support being moved to `master-5`.
| * Silence Clang-TidyOto Šťáva2024-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | This commit makes lots of changes to the C code to appease the Clang-Tidy linter. Some of the less obvious ones are due to C's weird semantics regarding handling of numeric literals. We also disable a bunch of the detections because they are super-pedantic, arguably useless, or we have our own unwritten coding style rules that solve the issues.
* | Merge branch 'master' into 6.0Vladimír Čunát2023-07-111-2/+2
|\|
| * treewide: fix -Wstrict-prototypesVladimír Čunát2023-06-081-2/+2
| |
* | Merge remote-tracking branch 'origin/6.0' into daemon-refactor-2Oto Šťáva2023-06-221-0/+1
|\ \
| * | new policy engine - prototypeVladimír Čunát2023-06-121-0/+1
| |/ | | | | | | | | | | Picked up old work, rebase-squashed after many months; then fixed up a little as needed in this newer version. (and later many minor fixes got squashed in)
* / session2: protocol layer APIOto Šťáva2023-01-261-0/+1
|/
* Copyright notices: remove years and replace e-mailOto Šťáva2022-12-141-1/+1
|
* lib/log: Coverity Scan nitsOto Šťáva2022-08-081-4/+10
| | | | Fixes CIDs 355763 and 355764. Also fixes a minor typo.
* lib/log: remove the unused log groupsVladimír Čunát2021-12-221-2/+0
| | | | We can always easily add groups when needed.
* lib/log: add LOG_GRP_EDETomas Krizek2021-12-211-0/+1
|
* renumber: warn when using unsupported network maskTomas Krizek2021-11-241-0/+1
|
* lib/log: check the *last* log group numberTomas Krizek2021-09-201-3/+1
|
* lib/log: add [rdebug] groupVladimír Čunát2021-08-101-0/+2
| | | | | | | It's special: always on and not shown in log_groups() output. It's been quite a long fight to find how to best deal with such a special case (from user perspective; code itself is easy).
* trace_log: include the "[group]" tag in the messagesVladimír Čunát2021-08-101-3/+3
|
* lib/log.h: improve readability (hopefully)Vladimír Čunát2021-07-291-0/+1
| | | | | | | | | | * improve order - follow grouping of topics more closely (targets, groups, levels) - order kr_log_LEVEL by severity * move unneeded <stdarg.h> * improve doc-comments - some claims there were even wrong now - describe some log levels at kr_log_LEVEL
* lib/log kr_log_name2grp(): return -1 on failuresVladimír Čunát2021-07-291-7/+7
| | | | | Let's be consistent witk kr_log_name2level() and even generally we tend to use negative numbers for errors.
* lib/log level names: disregard SYSLOG_NAMESVladimír Čunát2021-07-291-21/+24
| | | | | | | | | | | | | It's a non-standard feature of syslog.h and I don't think it's worth the trouble. We didn't really utilize it; someone would have to #define it, and moreover we would get into problems if this wasn't being done the same on all places including log.h. Making the names adapt to the platform would also mean that config files and docs wouldn't be portable. Also make kr_log_level2name() return const.
* logging: linter nitpicksTomas Krizek2021-07-291-2/+0
|
* logging: use log_groups() lua APITomas Krizek2021-07-291-4/+5
| | | | Use a single call as a setter and getter for log groups.
* log: use log_level() lua APITomas Krizek2021-07-291-9/+3
| | | | | Using a single function to get/set values is more consistent with our existing lua API rather than having two separate set and get functions.
* lib/log: redesign startup and target selectionVladimír Čunát2021-07-291-9/+14
| | | | | | | - add lua set_log_target() + docs - default to 'stderr' (manual runs) - switch to 'syslog' in distro-preconfig.lua - a few minor tweaks
* lib/log detail: avoid a bit of duplicationVladimír Čunát2021-07-291-6/+5
|
* lib/log.h: avoid defining types without kr_ prefixVladimír Čunát2021-07-291-8/+14
| | | | | Probably, it seems "more consistent". Some defines still don't have it, but I left those.
* log: add log functions and LOG_GRP_MODULE group for users's modulesLukáš Ježek2021-07-291-0/+1
| | | | logging
* lib/utils: drop a pair of unused macrosVladimír Čunát2021-07-291-2/+7
|
* lib/log: add kr_log_is_debug*()Vladimír Čunát2021-07-291-2/+12
| | | | ... and optimize a suspect hot path (through VERBOSE_MSG)
* lib/log: make trace-logging not prevent normal loggingVladimír Čunát2021-07-291-6/+2
| | | | | | | | I think it's an old issue, but why not fix it now. I believe it's better when these two are "independent". Removed comment: once upon a time it belonged to auto_free and similar macros, but somehow it survived various moves.
* rework logging from control sockets (+simplify)Vladimír Čunát2021-07-291-0/+1
| | | | | | | | | - unify interactive mode to stdout - use its own logging group - elevated log level when the command throws an exception - don't try detecting that the logs go back into the same console (yes, in that case you can see some lines twice) - don't make the binary mode turn off logging
* QRVERBOSE: fix ignoring the log groupsVladimír Čunát2021-07-291-0/+1
| | | | | | | | | | It would be yet another condition to check; overall I think the necessary checks would get too complex to be done in a macro and therefore copied all over the place. Note: it's interesting that such a change reduces binary size by about 3% (on master), and I suspect that speed won't suffer at all (after that TODO is done).
* lib/log: typing improvementsVladimír Čunát2021-07-291-10/+14
| | | | | | | - const for names of log groups - enum kr_log_group for a single log group - the kr_log_groups bitmap doesn't need to be exposed or even exported - return bool instead of int
* logging: fix GNUTLS loggingTomas Krizek2021-07-291-9/+19
| | | | | | - ensure gnutls logging can be turned on/off by using GNUTLS log group - keep TLS / TLSCLIENT as log groups for our TLS logs and use GNUTLS instead
* logging: use LOG_GRP_HTTP for http lua moduleTomas Krizek2021-07-291-0/+1
| | | | | | | It's better to use separate log group, to separate between logs that come from the lua module vs native C implementation. It is also more descriptive, since http modules is used for other stuff besides its deprecated DoH.
* logging: use dedicated DOTAUTH log for experimental auth DoTTomas Krizek2021-07-291-0/+1
|
* logging: add test for log groupsTomas Krizek2021-07-291-1/+1
| | | | | Besides testing the API, running this test also ensures all log groups have been properly defined (as long as kr_assertions are turned on).
* logging: add missing LOG_GRP_PLANTomas Krizek2021-07-291-0/+1
|
* logging: fix get_log_group()Tomas Krizek2021-07-291-2/+5
| | | | | | | | To ensure all log groups have been properly defined, iterate over the entire enum. If a value is missing, assert will be triggered. Also fixes groups with number >=32 (32bit value was used to test whether group is set before).
* logging: add LOG_GRP_DEVELTomas Krizek2021-07-291-0/+1
| | | | | | | | | This serves two purposes: 1. As a utility logger during development. 2. As the last entry in enum - to make iteration over the values possible. Changing the value of LOG_GRP_DEVEL shouldn't be an issue, since it shouldn't be used in production code.
* logging: print group name padded to 6 charactersTomas Krizek2021-07-291-1/+1
| | | | | Add space padding when printing the group name to allow usage of regular group names in lua code (e.g. "io" instead of "io ").
* logging: add get_log_group() with better APITomas Krizek2021-07-291-5/+5
| | | | | | | | The function returns a table where key is the group name and the value is either true (when logging selected group), or nil (when group isn't selected). This replaces the list_log_group() which didn't really work.
* logging: ensure get/set_log_level behaves consistentlyTomas Krizek2021-07-291-1/+3
| | | | | | Ensure both these functions return string that represents the log level. Also avoid using printf - it'd probably break API when using map().
* log: use kr_log_debug instead kr_log_verboseLukáš Ježek2021-07-291-0/+2
|
* log: fix CI testsLukáš Ježek2021-07-291-0/+1
|
* log: lua loggingLukáš Ježek2021-07-291-5/+26
|
* log: fix CI testsLukáš Ježek2021-07-291-3/+0
|
* log: shortening LOG_GRP_<SOMETHING> to <SOMETHING>Lukáš Ježek2021-07-291-1/+1
|
* log: remove hard-coded prefix from log messagesLukáš Ježek2021-07-291-1/+1
|
* log: add level prefix to each messageLukáš Ježek2021-07-291-14/+70
|
* log: groups lua interfaceLukáš Ježek2021-07-291-0/+45
|