build/log: support parsing global+subsystem levels

This makes it possible to specify both a global+subsystem loglevels,
like:
--debuglevel=debug,PEER=info,SRVR=trace
This commit is contained in:
Johan T. Halseth committed 2020-11-18 14:17:53 +01:00
1 parent fcf2e7f687
commit c1d423dc07
2 files changed
+32 -10

No files matched your search

+14
View File
@@ -75,6 +75,20 @@ func TestParseAndSetDebugLevels(t *testing.T) {
"SRVR": "debug",
},
},
{
name: "valid global+subsystem debug level",
debugLevel: "trace,PEER=info,SRVR=debug",
expGlobal: "trace",
expSubLevels: map[string]string{
"PEER": "info",
"SRVR": "debug",
},
},
{
name: "invalid global+subsystem debug level",
debugLevel: "PEER=info,debug,SRVR=debug",
expErr: "invalid",
},
}
for _, test := range testCases {