forked from cerc-io/plugeth
Check LogSystem type
This commit is contained in:
parent
1077109e11
commit
622bfd4f08
@ -75,8 +75,16 @@ func dispatchLoop() {
|
|||||||
|
|
||||||
func sysLoop(sys LogSystem, in <-chan message, wg *sync.WaitGroup) {
|
func sysLoop(sys LogSystem, in <-chan message, wg *sync.WaitGroup) {
|
||||||
for msg := range in {
|
for msg := range in {
|
||||||
if sys.GetLogLevel() >= msg.level {
|
switch sys.(type) {
|
||||||
sys.LogPrint(msg.level, msg.msg)
|
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()
|
wg.Done()
|
||||||
|
Loading…
Reference in New Issue
Block a user