forked from External/ergo
logger: Add notice on connection when server is logging all I/O
This commit is contained in:
parent
f1bf73c249
commit
25a373b7eb
2 changed files with 8 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue