aboutsummaryrefslogtreecommitdiffstats
path: root/logger/log.go
diff options
context:
space:
mode:
authorAlexandre Van de Sande <alex.vandesande@ethdev.com>2015-02-16 21:43:30 +0800
committerAlexandre Van de Sande <alex.vandesande@ethdev.com>2015-02-16 21:43:30 +0800
commit3068e2688d88912ec33f3d80fd0fe26c4e897dcd (patch)
treeee32ccd17faf650f3e933e9a2d8b4ab52f0d7746 /logger/log.go
parent1878630b591b039fadb6f88e15340d04f4af3ed1 (diff)
parent68f6ddc5aaa7ff29d09c1519ccd38d9cf16c0f75 (diff)
downloaddexon-3068e2688d88912ec33f3d80fd0fe26c4e897dcd.tar
dexon-3068e2688d88912ec33f3d80fd0fe26c4e897dcd.tar.gz
dexon-3068e2688d88912ec33f3d80fd0fe26c4e897dcd.tar.bz2
dexon-3068e2688d88912ec33f3d80fd0fe26c4e897dcd.tar.lz
dexon-3068e2688d88912ec33f3d80fd0fe26c4e897dcd.tar.xz
dexon-3068e2688d88912ec33f3d80fd0fe26c4e897dcd.tar.zst
dexon-3068e2688d88912ec33f3d80fd0fe26c4e897dcd.zip
merge conflicts
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