aboutsummaryrefslogtreecommitdiffstats
path: root/logger/sys.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-01-22 00:58:09 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-01-22 00:58:09 +0800
commit622bfd4f0815b9220f02e6b79f74ed1c77ec7649 (patch)
tree0f121148a906c28f11277cc28f94b41ee95625d3 /logger/sys.go
parent1077109e1153cc4fb4eece59dd48cd9f640d0e0b (diff)
downloadgo-tangerine-622bfd4f0815b9220f02e6b79f74ed1c77ec7649.tar
go-tangerine-622bfd4f0815b9220f02e6b79f74ed1c77ec7649.tar.gz
go-tangerine-622bfd4f0815b9220f02e6b79f74ed1c77ec7649.tar.bz2
go-tangerine-622bfd4f0815b9220f02e6b79f74ed1c77ec7649.tar.lz
go-tangerine-622bfd4f0815b9220f02e6b79f74ed1c77ec7649.tar.xz
go-tangerine-622bfd4f0815b9220f02e6b79f74ed1c77ec7649.tar.zst
go-tangerine-622bfd4f0815b9220f02e6b79f74ed1c77ec7649.zip
Check LogSystem type
Diffstat (limited to 'logger/sys.go')
-rw-r--r--logger/sys.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/logger/sys.go b/logger/sys.go
index 59b8582f9..bd826b587 100644
--- a/logger/sys.go
+++ b/logger/sys.go
@@ -75,8 +75,16 @@ func dispatchLoop() {
func sysLoop(sys LogSystem, in <-chan message, wg *sync.WaitGroup) {
for msg := range in {
- if sys.GetLogLevel() >= msg.level {
- sys.LogPrint(msg.level, msg.msg)
+ switch sys.(type) {
+ case *rawLogSystem:
+ // This is a semantic hack since rawLogSystem has little to do with JsonLevel
+ if msg.level == JsonLevel {
+ sys.LogPrint(msg.level, msg.msg)
+ }
+ default:
+ if sys.GetLogLevel() >= msg.level {
+ sys.LogPrint(msg.level, msg.msg)
+ }
}
}
wg.Done()