Commit Graph
12 Commits
Author SHA1 Message Date
Joachim Nilsson e46e3cdcb6 log.c: Filter debug messages by default, like before refactor
Ways to log:
- Set debug, using kernel cmdline, or edit the sources
- Change loglevel severity, default blocks > LOG_NOTICE

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 21:56:19 +02:00
Joachim Nilsson 516dbcc512 Remove --disable-quiet and quiet mode, default to a sane behavior
This patch is a follow-up to 1f1c2e0 which introduced the new semantics
for the very confusing quiet and silent modes.

The initial idea was to loosely follow the kernel cmdline 'quiet' option
and as a working concept this was good.  The resulting code, however,
became unnecessarily complex and the configure options impossible to
explain.

With this patch the quiet mode, and thus the --disable-quiet configure
option, is removed.  Finit now defaults to a sane behavior: services are
shown only at startup.   The --enable-silent option works like it did
before, silencing everything.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 13:40:54 +02:00
Joachim Nilsson 7a48240856 log.c: Do reopen syslog() when toggling debug => LOG_PERROR
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 13:19:22 +02:00
Joachim Nilsson cd947a69a8 log.c: New functions to hide access to quiet and silent flags
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 12:42:44 +02:00
Joachim Nilsson 51e1a907e6 log.c: New log_is_debug() function, hide access to debug variable
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 12:40:50 +02:00
Joachim Nilsson bd54cf6dee log.c: New log_init() function, called at initial bootstrap
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 12:34:12 +02:00
Joachim Nilsson 1036c365b8 log.c: New log_exit() function, called at shutdown
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 12:31:38 +02:00
Joachim Nilsson 8ce330bcdb log.c: Rename log_toggle_debug() --> log_debug()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-02 12:28:16 +02:00
Joachim Nilsson ec52a6a240 Set correct syslog() log level based on debug flag
Also, refactor logging to /dev/kmsg to separate function.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-01 22:23:53 +02:00
Joachim Nilsson 5e8cb63f9a Refactor, _d() et al to use logit() instead of err.h
This patch is the first in a series of changes to clean up the internal
logging APIs of Finit:

  1. Convert log macros to use logit() for everything (this patch)
  2. Set correct syslog() log level based on debug flag
  3. Do closelog()/openlog() when toggling debug flag to control LOG_PERROR

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-01 20:34:37 +02:00
Joachim Nilsson d1df837d04 Refactor, move debug toggle to log.c:log_toggle_debug()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-01 20:34:37 +02:00
Joachim Nilsson 670f08ce51 Refactor, move logit() and log macros to log.c + log.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-07-01 20:34:37 +02:00