mirror of
https://github.com/troglobit/finit.git
synced 2026-10-13 10:14:47 +00:00
Add _w() for developer warning logs
Adjust debug levels slightly and add _w() macro for LOG_WARNING, useful when having /dev/kmsg as backend. The latter outputs any log <= LOG_ERR to console as well. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -38,8 +38,9 @@
|
||||
* /dev/console as well. Useful for critical errors and early debug.
|
||||
*/
|
||||
#define _l(prio, fmt, args...) do { if (_slup) warnx(fmt, ##args); logit(prio, fmt "\n", ##args); } while (0)
|
||||
#define _m(prio, fmt, args...) do { _l(prio, "finit:%s:%s() - " fmt, __FILE__, __func__, ##args); } while (0)
|
||||
#define _m(prio, fmt, args...) do { _l(prio, "%s() - " fmt, __func__, ##args); } while (0)
|
||||
#define _d(fmt, args...) do { if (debug) { _m(LOG_DEBUG, fmt, ##args); } } while (0)
|
||||
#define _w(fmt, args...) do { _m(LOG_WARNING, fmt, ##args); } while (0)
|
||||
#define _e(fmt, args...) do { _m(LOG_ERR, fmt, ##args); } while (0)
|
||||
#define _pe(fmt, args...) do { _m(LOG_ERR, fmt ". Error %d: %s", ##args, errno, strerror(errno)); } while (0)
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ static int service_start(svc_t *svc)
|
||||
if (strlen(arg) < (sizeof(buf) - strlen(buf)))
|
||||
strcat(buf, arg);
|
||||
}
|
||||
_e("Starting %s: %s", svc->cmd, buf);
|
||||
_d("Starting %s: %s", svc->cmd, buf);
|
||||
}
|
||||
|
||||
svc->pid = pid;
|
||||
@@ -548,7 +548,7 @@ int service_register(int type, char *line, time_t mtime, char *username)
|
||||
|
||||
plugin = plugin_find(ps);
|
||||
if (!plugin || !plugin->inetd.cmd) {
|
||||
_e("Inetd service %s has no internal plugin, skipping.", service);
|
||||
_w("Inetd service %s has no internal plugin, skipping.", service);
|
||||
return errno = ENOENT;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user