diff options
Diffstat (limited to 'logger')
-rw-r--r-- | logger/log.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/logger/log.go b/logger/log.go index 53065f870..baa3dfaf2 100644 --- a/logger/log.go +++ b/logger/log.go @@ -18,7 +18,7 @@ func openLogFile(datadir string, filename string) *os.File { return file } -func New(datadir string, logFile string, logLevel int) LogSystem { +func New(datadir string, logFile string, logLevel int, logFormat string) LogSystem { var writer io.Writer if logFile == "" { writer = os.Stdout @@ -26,7 +26,13 @@ func New(datadir string, logFile string, logLevel int) LogSystem { writer = openLogFile(datadir, logFile) } - sys := NewStdLogSystem(writer, log.LstdFlags, LogLevel(logLevel)) + var sys LogSystem + switch logFormat { + case "raw": + sys = NewRawLogSystem(writer, 0, LogLevel(logLevel)) + default: + sys = NewStdLogSystem(writer, log.LstdFlags, LogLevel(logLevel)) + } AddLogSystem(sys) return sys |