Skip to content
Snippets Groups Projects
Commit c226475c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow a separate log level for the event thread of the terminal server

So you want to debug (timed) events, but don't want to get debug-spew in your
terminal server log output? Now you can: By default, the event thread log
level will be the same as the terminal server, but now you can override this
by setting [BBS] EventLogLevel in the sbbs.ini file or set it in
SCFG->Servers->Terminal Server->Event Log Level.
parent 37ca25a5
Branches
Tags
No related merge requests found
Pipeline #7139 passed
...@@ -266,7 +266,7 @@ int eputs(int level, const char *str) ...@@ -266,7 +266,7 @@ int eputs(int level, const char *str)
startup->errormsg(startup->cbdata, level, errmsg); startup->errormsg(startup->cbdata, level, errmsg);
} }
if(startup==NULL || startup->event_lputs==NULL || level > startup->log_level) if(startup==NULL || startup->event_lputs==NULL || level > startup->event_log_level)
return(0); return(0);
return(startup->event_lputs(startup->event_cbdata,level,str)); return(startup->event_lputs(startup->event_cbdata,level,str));
......
...@@ -47,6 +47,7 @@ static const char* strMaxSFTPInactivity="MaxSFTPInactivity"; ...@@ -47,6 +47,7 @@ static const char* strMaxSFTPInactivity="MaxSFTPInactivity";
static const char* strMaxConConn="MaxConcurrentConnections"; static const char* strMaxConConn="MaxConcurrentConnections";
static const char* strHostName="HostName"; static const char* strHostName="HostName";
static const char* strLogLevel="LogLevel"; static const char* strLogLevel="LogLevel";
static const char* strEventLogLevel="EventLogLevel";
static const char* strTLSErrorLevel="TLSErrorLevel"; static const char* strTLSErrorLevel="TLSErrorLevel";
static const char* strBindRetryCount="BindRetryCount"; static const char* strBindRetryCount="BindRetryCount";
static const char* strBindRetryDelay="BindRetryDelay"; static const char* strBindRetryDelay="BindRetryDelay";
...@@ -504,6 +505,8 @@ void sbbs_read_ini( ...@@ -504,6 +505,8 @@ void sbbs_read_ini(
bbs->log_level bbs->log_level
=iniGetLogLevel(list,section,strLogLevel,global->log_level); =iniGetLogLevel(list,section,strLogLevel,global->log_level);
bbs->event_log_level
=iniGetLogLevel(list,section,strEventLogLevel,bbs->log_level);
bbs->options bbs->options
=iniGetBitField(list,section,strOptions,bbs_options =iniGetBitField(list,section,strOptions,bbs_options
,BBS_OPT_XTRN_MINIMIZED); ,BBS_OPT_XTRN_MINIMIZED);
...@@ -957,6 +960,10 @@ bool sbbs_write_ini( ...@@ -957,6 +960,10 @@ bool sbbs_write_ini(
iniRemoveValue(lp,section,strLogLevel); iniRemoveValue(lp,section,strLogLevel);
else if(!iniSetLogLevel(lp,section,strLogLevel,bbs->log_level,&style)) else if(!iniSetLogLevel(lp,section,strLogLevel,bbs->log_level,&style))
break; break;
if(bbs->event_log_level==bbs->log_level)
iniRemoveValue(lp,section,strEventLogLevel);
else if(!iniSetLogLevel(lp,section,strEventLogLevel,bbs->event_log_level,&style))
break;
/* JavaScript operating parameters */ /* JavaScript operating parameters */
if(!sbbs_set_js_settings(lp,section,&bbs->js,&global->js,&style)) if(!sbbs_set_js_settings(lp,section,&bbs->js,&global->js,&style))
......
...@@ -566,6 +566,8 @@ static void termsrvr_cfg(void) ...@@ -566,6 +566,8 @@ static void termsrvr_cfg(void)
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Execute Timed Events", startup.options & BBS_OPT_NO_EVENTS ? "No" : "Yes"); snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Execute Timed Events", startup.options & BBS_OPT_NO_EVENTS ? "No" : "Yes");
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Execute QWK-related Events" snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Execute QWK-related Events"
,startup.options & BBS_OPT_NO_EVENTS ? "N/A" : startup.options & BBS_OPT_NO_QWK_EVENTS ? "No" : "Yes"); ,startup.options & BBS_OPT_NO_EVENTS ? "N/A" : startup.options & BBS_OPT_NO_QWK_EVENTS ? "No" : "Yes");
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Event Log Level"
,startup.options & BBS_OPT_NO_EVENTS ? "N/A" : iniLogLevelStringList()[startup.event_log_level]);
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Lookup Client Hostname", startup.options & BBS_OPT_NO_HOST_LOOKUP ? "No" : "Yes"); snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Lookup Client Hostname", startup.options & BBS_OPT_NO_HOST_LOOKUP ? "No" : "Yes");
snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Login Requirements", startup.login_ars); snprintf(opt[i++], MAX_OPLN, "%-30s%s", "Login Requirements", startup.login_ars);
strcpy(opt[i++], "JavaScript Settings..."); strcpy(opt[i++], "JavaScript Settings...");
...@@ -693,15 +695,20 @@ static void termsrvr_cfg(void) ...@@ -693,15 +695,20 @@ static void termsrvr_cfg(void)
startup.options ^= BBS_OPT_NO_QWK_EVENTS; startup.options ^= BBS_OPT_NO_QWK_EVENTS;
break; break;
case 16: case 16:
startup.options ^= BBS_OPT_NO_HOST_LOOKUP; if(startup.options & BBS_OPT_NO_EVENTS)
break;
uifc.list(WIN_MID|WIN_SAV, 0, 0, 0, &startup.event_log_level, 0, "Event Log Level", iniLogLevelStringList());
break; break;
case 17: case 17:
getar("Terminal Server Login", startup.login_ars); startup.options ^= BBS_OPT_NO_HOST_LOOKUP;
break; break;
case 18: case 18:
js_startup_cfg(&startup.js); getar("Terminal Server Login", startup.login_ars);
break; break;
case 19: case 19:
js_startup_cfg(&startup.js);
break;
case 20:
login_attempt_cfg(&startup.login_attempt); login_attempt_cfg(&startup.login_attempt);
break; break;
default: default:
......
...@@ -132,6 +132,7 @@ typedef struct { ...@@ -132,6 +132,7 @@ typedef struct {
uint16_t ssh_port; uint16_t ssh_port;
uint16_t ssh_connect_timeout; uint16_t ssh_connect_timeout;
int ssh_error_level; int ssh_error_level;
int event_log_level;
uint16_t outbuf_highwater_mark; /* output block size control */ uint16_t outbuf_highwater_mark; /* output block size control */
uint16_t outbuf_drain_timeout; uint16_t outbuf_drain_timeout;
struct in_addr outgoing4; struct in_addr outgoing4;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment