mirror of
https://github.com/troglobit/finit.git
synced 2026-10-24 11:54:36 +00:00
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>
This commit is contained in:
1 parent
9a4f46dba4
commit
ec52a6a240
2 files changed
+40
-33
No files matched your search
@@ -35,10 +35,10 @@
|
||||
* The default log level is LOG_NOTICE. To toggle LOG_DEBUG messages,
|
||||
* use `initctl debug` or add `--debug` to the kernel cmdline.
|
||||
*/
|
||||
#define _d(fmt, args...) logit(LOG_DEBUG, "%s():" fmt, __func__, ##args)
|
||||
#define _w(fmt, args...) logit(LOG_WARNING, "%s():" fmt, __func__, ##args)
|
||||
#define _e(fmt, args...) logit(LOG_ERR, "%s():" fmt, __func__, ##args)
|
||||
#define _pe(fmt, args...) logit(LOG_ERR, "%s():" fmt ": %m", __func__, ##args)
|
||||
#define _d(fmt, args...) logit(LOG_DEBUG, "%s():" fmt "\n", __func__, ##args)
|
||||
#define _w(fmt, args...) logit(LOG_WARNING, "%s():" fmt "\n", __func__, ##args)
|
||||
#define _e(fmt, args...) logit(LOG_ERR, "%s():" fmt "\n", __func__, ##args)
|
||||
#define _pe(fmt, args...) logit(LOG_ERR, "%s():" fmt ": %m\n", __func__, ##args)
|
||||
|
||||
void log_toggle_debug(void);
|
||||
void logit (int prio, const char *fmt, ...);
|
||||
|
||||
Reference in new issue
Block a user