mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-26 06:03:20 -05:00
Always log fatal errors to the console
This commit is contained in:
parent
7aa6aa0062
commit
ce0cde027f
@ -118,11 +118,17 @@ void err_log(int level, unsigned int cat, char *fmt, ...)
|
|||||||
|
|
||||||
err_lock_mutex(); /* atomic file writes */
|
err_lock_mutex(); /* atomic file writes */
|
||||||
|
|
||||||
|
if((!level) && (err_logdestination != LOGDEST_STDERR)) {
|
||||||
|
fprintf(stderr,"%s",errbuf);
|
||||||
|
fprintf(stderr,"Aborting\n");
|
||||||
|
fflush(stderr); /* shouldn't have to do this? */
|
||||||
|
}
|
||||||
|
|
||||||
switch(err_logdestination) {
|
switch(err_logdestination) {
|
||||||
case LOGDEST_LOGFILE:
|
case LOGDEST_LOGFILE:
|
||||||
tt_now=time(NULL);
|
tt_now=time(NULL);
|
||||||
localtime_r(&tt_now,&tm_now);
|
localtime_r(&tt_now,&tm_now);
|
||||||
strftime(timebuf,sizeof(timebuf),"%F %T",&tm_now);
|
strftime(timebuf,sizeof(timebuf),"%Y-%m-%d %T",&tm_now);
|
||||||
fprintf(err_file,"%s: %s",timebuf,errbuf);
|
fprintf(err_file,"%s: %s",timebuf,errbuf);
|
||||||
if(!level) fprintf(err_file,"%s: Aborting\n",timebuf);
|
if(!level) fprintf(err_file,"%s: Aborting\n",timebuf);
|
||||||
fflush(err_file);
|
fflush(err_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user