From 6f5b8b6e96767ea6c2cb3cedec4451a8e5d324e5 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Tue, 13 Apr 2004 04:27:04 +0000 Subject: [PATCH] logging fixes --- src/err.c | 6 +++--- src/main.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/err.c b/src/err.c index 411c636c..2973d840 100644 --- a/src/err.c +++ b/src/err.c @@ -88,8 +88,8 @@ void log_err(int level, char *fmt, ...) tt_now=time(NULL); gmtime_r(&tt_now,&tm_now); strftime(timebuf,sizeof(timebuf),"%F %T",&tm_now); - fprintf(err_file,"%s %s: ",timebuf,errbuf); - if(!level) fprintf(err_file,"%s %s: Aborting\n"); + fprintf(err_file,"%s: %s",timebuf,errbuf); + if(!level) fprintf(err_file,"%s: Aborting\n",timebuf); fflush(err_file); break; case LOGDEST_STDERR: @@ -127,7 +127,7 @@ void log_setdest(char *app, int destination) { switch(destination) { case LOGDEST_LOGFILE: - err_file=fopen(app,"w+"); + err_file=fopen(app,"a"); if(err_file==NULL) { fprintf(stderr,"Error opening %s: %s\n",app,strerror(errno)); exit(EXIT_FAILURE); diff --git a/src/main.c b/src/main.c index 4593e9fc..23e4af71 100644 --- a/src/main.c +++ b/src/main.c @@ -276,7 +276,7 @@ void daap_handler(WS_CONNINFO *pwsc) { ws_emitheaders(pwsc); config_set_status(pwsc,session_id,"Streaming file '%s'",pmp3->fname); - DPRINTF(ERR_LOG,"Session %d: Streaming %s to %s\n",session_id, + DPRINTF(ERR_LOG,"Session %d: Streaming file '%s' to %s\n",session_id, pmp3->fname, pwsc->hostname); config.stats.songs_served++; /* FIXME: remove stat races */