Bug Description
In config_loader.go, the log level set by the user in the configuration file is overridden by an environment variable check. If a user explicitly sets log_level = 0 (debug) in the config file but does not set the DEBUG environment variable, the log level gets silently overridden to info.
Affected Code
config_loader.go:32-34:
if dlog.LogLevel() <= dlog.SeverityDebug && os.Getenv("DEBUG") == "" {
dlog.SetLogLevel(dlog.SeverityInfo)
}
Impact
User-configured debug logging is silently ignored. Users who set log_level = 0 in their config file expecting debug output will not see it unless they also set the DEBUG environment variable. This is surprising behavior and contradicts the explicit configuration file setting.
Fix
Either remove this override entirely (letting the config file control log level) or document it clearly and only apply it when the user hasn't explicitly configured the log level:
// Only override if the user hasn't explicitly set a log level in the config
if os.Getenv("DEBUG") == "" && defaultLogLevelUsed {
// ...
}
Bug Description
In
config_loader.go, the log level set by the user in the configuration file is overridden by an environment variable check. If a user explicitly setslog_level = 0(debug) in the config file but does not set theDEBUGenvironment variable, the log level gets silently overridden to info.Affected Code
config_loader.go:32-34:Impact
User-configured debug logging is silently ignored. Users who set
log_level = 0in their config file expecting debug output will not see it unless they also set theDEBUGenvironment variable. This is surprising behavior and contradicts the explicit configuration file setting.Fix
Either remove this override entirely (letting the config file control log level) or document it clearly and only apply it when the user hasn't explicitly configured the log level: