Skip to content
Snippets Groups Projects
Commit affd038c authored by rswindell's avatar rswindell
Browse files

Enable syslog() output for *nix builds if "syslog=true" is set in sexyz.ini or

"-syslog" is passed on the command-line.
parent 05febd39
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,7 @@ BOOL dszlog_path=TRUE; /* Log complete path to filename */
BOOL dszlog_short=FALSE; /* Log Micros~1 short filename */
BOOL dszlog_quotes=FALSE; /* Quote filenames in DSZLOG */
int log_level=LOG_INFO;
BOOL use_syslog=FALSE;
xmodem_t xm;
zmodem_t zm;
......@@ -172,6 +173,11 @@ static int lputs(void* unused, int level, const char* str)
if(level>log_level)
return 0;
#if defined(__unix__)
if(use_syslog)
return syslog(level,"%s",str);
#endif
if(level<LOG_NOTICE)
fp=errfp;
......@@ -1359,6 +1365,7 @@ int main(int argc, char **argv)
pause_on_abend =iniReadBool(fp,ROOT_SECTION,"PauseOnAbend",FALSE);
log_level =iniReadLogLevel(fp,ROOT_SECTION,"LogLevel",log_level);
use_syslog =iniReadBool(fp,ROOT_SECTION,"SysLog",use_syslog);
outbuf.highwater_mark =iniReadInteger(fp,ROOT_SECTION,"OutbufHighwaterMark",1100);
outbuf_drain_timeout =iniReadInteger(fp,ROOT_SECTION,"OutbufDrainTimeout",10);
......@@ -1507,6 +1514,10 @@ int main(int argc, char **argv)
log_level=LOG_DEBUG;
continue;
}
if(stricmp(arg,"syslog")==0) {
use_syslog=TRUE;
continue;
}
if(stricmp(arg,"quotes")==0) {
dszlog_quotes=TRUE;
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment