allow printlog() to be used with variable arg list (like print()):
printlog("warn", "Monty", "Burns");
This commit is contained in:
parent
003ae0986f
commit
dc6ab58eaf
1 changed files with 4 additions and 1 deletions
|
@ -100,5 +100,8 @@ defined = func(sym) {
|
||||||
_ = {};
|
_ = {};
|
||||||
_.dbg_types = { none:0, bulk:1, debug:2, info:3, warn:4, alert:5 };
|
_.dbg_types = { none:0, bulk:1, debug:2, info:3, warn:4, alert:5 };
|
||||||
_.log_level = _.dbg_types[getprop("/sim/logging/priority")];
|
_.log_level = _.dbg_types[getprop("/sim/logging/priority")];
|
||||||
printlog = func(t, m) { if(_.dbg_types[t] >= _.log_level) { print(m) } }
|
printlog = func(level, text...) {
|
||||||
|
if(_.dbg_types[level] >= _.log_level) { call(print, text) }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue