summaryrefslogtreecommitdiff
path: root/logger.c
diff options
context:
space:
mode:
authorMatt O'Gorman <mogorman@digium.com>2006-02-08 23:14:17 +0000
committerMatt O'Gorman <mogorman@digium.com>2006-02-08 23:14:17 +0000
commit5f0de64f780aeea5117239265f09f33bbfde5bfa (patch)
tree249311b44c8925e58502063381858cbdab987827 /logger.c
parent8774e4a7d88906836b7f89579b20c87fb9aed81a (diff)
Merged revisions 9232 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.2 ........ r9232 | mogorman | 2006-02-08 16:12:34 -0600 (Wed, 08 Feb 2006) | 4 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@9239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 afdfa58d1..0ad5e3f9f 100644
--- a/logger.c
+++ b/logger.c
@@ -314,9 +314,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"))) {