Tinyproxy log level parameter fix #77

This commit is contained in:
Quentin McGaw (desktop)
2020-02-08 00:10:52 +00:00
parent ed5a90ef25
commit 63fd72524e
3 changed files with 7 additions and 3 deletions

View File

@@ -30,10 +30,10 @@ func (p *paramsReader) GetTinyProxyLog() (models.TinyProxyLogLevel, error) {
return models.TinyProxyLogLevel(s), err
} else if len(s) != 0 {
p.logger.Warn("You are using the old environment variable PROXY_LOG_LEVEL, please consider changing it to TINYPROXY_LOG")
s, err = p.envParams.GetValueIfInside("PROXY_LOG_LEVEL", []string{"info", "warning", "error", "critical"}, libparams.Compulsory())
s, err = p.envParams.GetValueIfInside("PROXY_LOG_LEVEL", []string{"Info", "Connect", "Notice", "Warning", "Error", "Critical"}, libparams.Compulsory())
return models.TinyProxyLogLevel(s), err
}
s, err = p.envParams.GetValueIfInside("TINYPROXY_LOG", []string{"Info", "Warning", "Error", "Critical"}, libparams.Default("info"))
s, err = p.envParams.GetValueIfInside("TINYPROXY_LOG", []string{"Info", "Connect", "Notice", "Warning", "Error", "Critical"}, libparams.Default("Connect"))
return models.TinyProxyLogLevel(s), err
}