1
0
Fork 0
forked from External/ergo

logger: Add notice on connection when server is logging all I/O

This commit is contained in:
Daniel Oaks 2017-03-08 21:57:31 +10:00
parent f1bf73c249
commit 25a373b7eb
2 changed files with 8 additions and 1 deletions

View file

@ -48,7 +48,8 @@ var (
// Logger is the main interface used to log debug/info/error messages.
type Logger struct {
loggers []SingleLogger
loggers []SingleLogger
DumpingRawInOut bool
}
// NewLogger returns a new Logger.
@ -66,6 +67,9 @@ func NewLogger(config []LoggingConfig) (*Logger, error) {
Types: logConfig.Types,
ExcludedTypes: logConfig.ExcludedTypes,
}
if logConfig.Types["userinput"] || logConfig.Types["useroutput"] || (logConfig.Types["*"] && !(logConfig.ExcludedTypes["userinput"] && logConfig.ExcludedTypes["useroutput"])) {
logger.DumpingRawInOut = true
}
if sLogger.MethodFile.Enabled {
file, err := os.OpenFile(sLogger.MethodFile.Filename, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0666)
if err != nil {