* the fs. If we don't use /dev/kmsg we still keep it open,
* because there is no reason to close it. */
+ if (log_target == LOG_TARGET_NULL) {
+ log_close_syslog();
+ log_close_console();
+ return 0;
+ }
+
if (log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
log_target == LOG_TARGET_SYSLOG)
if ((r = log_open_syslog()) >= 0) {
assert(target < _LOG_TARGET_MAX);
log_target = target;
+ log_open();
}
void log_set_max_level(int level) {
int r = 0;
+ if (log_target == LOG_TARGET_NULL)
+ return 0;
+
do {
char *e;
int k;
[LOG_TARGET_SYSLOG] = "syslog",
[LOG_TARGET_KMSG] = "kmsg",
[LOG_TARGET_SYSLOG_OR_KMSG] = "syslog-or-kmsg",
+ [LOG_TARGET_NULL] = "null"
};
DEFINE_STRING_TABLE_LOOKUP(log_target, LogTarget);