aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authormogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-08 22:12:34 +0000
committermogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-08 22:12:34 +0000
commit584e2176716785310c23ca9911109120b5dc0a81 (patch)
tree70d31fdf73899db5d7c1db8eadb178fe4b446fa1 /logger.c
parentda8bfb7a17bd394b54686e5991695d8c18ff3222 (diff)
Make logger report error,warning,notice if logger.conf
not found, also updated chan_oss to give correct error message if its config file is not found. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@9232 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rw-r--r--logger.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/logger.c b/logger.c
index 06fcf9a80..a6e07d6f8 100644
--- a/logger.c
+++ b/logger.c
@@ -309,9 +309,18 @@ static void init_logger_chain(void)
cfg = ast_config_load("logger.conf");
- /* If no config file, we're fine */
- if (!cfg)
+ /* If no config file, we're fine, set default options. */
+ if (!cfg) {
+ fprintf(stderr, "Unable to open logger.conf: %s\n", strerror(errno));
+ chan = malloc(sizeof(struct logchannel));
+ memset(chan, 0, sizeof(struct logchannel));
+ chan->type = LOGTYPE_CONSOLE;
+ chan->logmask = 28; /*warning,notice,error */
+ chan->next = logchannels;
+ logchannels = chan;
+ global_logmask |= chan->logmask;
return;
+ }
ast_mutex_lock(&loglock);
if ((s = ast_variable_retrieve(cfg, "general", "appendhostname"))) {