aboutsummaryrefslogtreecommitdiffstats
path: root/logger/log.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-14 00:00:15 +0800
committerobscuren <geffobscura@gmail.com>2015-02-14 00:00:15 +0800
commit8305d409d2ca83583d9fa7e837ec0a46ce6ba78e (patch)
tree956c768957f56044113772a88a9cbe7de0ef9cf1 /logger/log.go
parentb64ad7a2a6544564b68f362f18c70476310396d6 (diff)
parent5c251b69282b3992512d0c17ed0063f294a0e663 (diff)
downloadgo-tangerine-8305d409d2ca83583d9fa7e837ec0a46ce6ba78e.tar
go-tangerine-8305d409d2ca83583d9fa7e837ec0a46ce6ba78e.tar.gz
go-tangerine-8305d409d2ca83583d9fa7e837ec0a46ce6ba78e.tar.bz2
go-tangerine-8305d409d2ca83583d9fa7e837ec0a46ce6ba78e.tar.lz
go-tangerine-8305d409d2ca83583d9fa7e837ec0a46ce6ba78e.tar.xz
go-tangerine-8305d409d2ca83583d9fa7e837ec0a46ce6ba78e.tar.zst
go-tangerine-8305d409d2ca83583d9fa7e837ec0a46ce6ba78e.zip
Merge branch 'develop' into miner
Diffstat (limited to 'logger/log.go')
-rw-r--r--logger/log.go10
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