summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/log.c2
-rw-r--r--src/log_targets.h8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/log.c b/src/log.c
index c3748d7..6f3d6da 100644
--- a/src/log.c
+++ b/src/log.c
@@ -120,6 +120,8 @@ int log_targets_add(log_targets_t* targets, const char* conf)
return -1;
}
new_target->max_prio_ = prioptr[0] - '0';
+ if(new_target->max_prio_ > 0)
+ new_target->enabled_ = 1;
if(new_target->init != NULL) {
const char* confptr = NULL;
diff --git a/src/log_targets.h b/src/log_targets.h
index 8357f4d..5ee23d4 100644
--- a/src/log_targets.h
+++ b/src/log_targets.h
@@ -165,7 +165,7 @@ log_target_t* log_target_syslog_new()
tmp->close = &log_target_syslog_close;
tmp->clear = &log_target_syslog_clear;
tmp->opened_ = 0;
- tmp->enabled_ = 1;
+ tmp->enabled_ = 0;
tmp->max_prio_ = NOTICE;
tmp->param_ = NULL;
tmp->next_ = NULL;
@@ -273,7 +273,7 @@ log_target_t* log_target_file_new()
tmp->close = &log_target_file_close;
tmp->clear = &log_target_file_clear;
tmp->opened_ = 0;
- tmp->enabled_ = 1;
+ tmp->enabled_ = 0;
tmp->max_prio_ = NOTICE;
tmp->param_ = NULL;
tmp->next_ = NULL;
@@ -300,7 +300,7 @@ log_target_t* log_target_stdout_new()
tmp->close = NULL;
tmp->clear = NULL;
tmp->opened_ = 0;
- tmp->enabled_ = 1;
+ tmp->enabled_ = 0;
tmp->max_prio_ = NOTICE;
tmp->param_ = NULL;
tmp->next_ = NULL;
@@ -327,7 +327,7 @@ log_target_t* log_target_stderr_new()
tmp->close = NULL;
tmp->clear = NULL;
tmp->opened_ = 0;
- tmp->enabled_ = 1;
+ tmp->enabled_ = 0;
tmp->max_prio_ = NOTICE;
tmp->param_ = NULL;
tmp->next_ = NULL;