logging fixes

This commit is contained in:
Ron Pedde 2004-04-13 04:27:04 +00:00
parent 6170df9af4
commit 6f5b8b6e96
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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 */