aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-07-29 22:40:07 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2002-07-29 22:40:07 +0000
commit39a1bb8d384394967a634bb96a23c5f184d7dac9 (patch)
tree191e38c2ec01c4f1bbcf89f9251c14055a1490bb /logger.c
parentd8b16d3050ccdb54c8756d65accc37c3c4877c1c (diff)
Version 0.2.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@493 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rwxr-xr-xlogger.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/logger.c b/logger.c
index 9da8b62e7..f48296130 100755
--- a/logger.c
+++ b/logger.c
@@ -166,6 +166,7 @@ static void init_logger_chain(void)
/* Gotta have at least one. We'll make a NULL one */
logfiles = make_logfile("ignore", "", -1);
}
+ ast_destroy(cfg);
ast_pthread_mutex_unlock(&loglock);
@@ -227,9 +228,7 @@ extern void ast_log(int level, char *file, int line, char *function, char *fmt,
struct logfile *f;
va_list ap;
- va_start(ap, fmt);
if (!option_verbose && !option_debug && (!level)) {
- va_end(ap);
return;
}
ast_pthread_mutex_lock(&loglock);
@@ -240,12 +239,14 @@ extern void ast_log(int level, char *file, int line, char *function, char *fmt,
/* Log events into the event log file, with a different format */
strftime(date, sizeof(date), "%b %e %T", tm);
fprintf(eventlog, "%s asterisk[%d]: ", date, getpid());
+ va_start(ap, fmt);
vfprintf(eventlog, fmt, ap);
+ va_end(ap);
fflush(eventlog);
} else
/** Cannot use ast_log() from locked section of ast_log()!
ast_log(LOG_WARNING, "Unable to retrieve local time?\n"); **/
- fprintf(stderr, "ast_log: Unable to retrieve local time for %d?\n", t);
+ fprintf(stderr, "ast_log: Unable to retrieve local time for %ld?\n", t);
} else {
if (logfiles) {
f = logfiles;
@@ -265,10 +266,10 @@ extern void ast_log(int level, char *file, int line, char *function, char *fmt,
term_color(tmp3, linestr, COLOR_BRWHITE, 0, sizeof(tmp3)),
term_color(tmp4, function, COLOR_BRWHITE, 0, sizeof(tmp4)));
}
- vfprintf(f->f, fmt, ap);
va_start(ap, fmt);
- fflush(f->f);
+ vfprintf(f->f, fmt, ap);
va_end(ap);
+ fflush(f->f);
}
f = f->next;
}
@@ -281,7 +282,6 @@ extern void ast_log(int level, char *file, int line, char *function, char *fmt,
}
}
ast_pthread_mutex_unlock(&loglock);
- va_end(ap);
}
extern void ast_verbose(char *fmt, ...)