1
0
Fork 0

use __ for static variables (one underscore is too handy for use in other

modules to waste it here)
This commit is contained in:
mfranz 2006-02-18 00:12:09 +00:00
parent f9089e95d6
commit cde64c8543

View file

@ -95,13 +95,14 @@ defined = func(sym) {
##
# Print log messages in appropriate --log-level.
# Usage: printlog("warn", "...");
# The underscore hash is used for private variables.
# The underscore hash prevents helper functions/variables from
# needlessly polluting the global namespace.
#
_ = {};
_.dbg_types = { none:0, bulk:1, debug:2, info:3, warn:4, alert:5 };
_.log_level = _.dbg_types[getprop("/sim/logging/priority")];
printlog = func(level, text...) {
if(_.dbg_types[level] >= _.log_level) { call(print, text) }
__ = {};
__.dbg_types = { none:0, bulk:1, debug:2, info:3, warn:4, alert:5 };
__.log_level = __.dbg_types[getprop("/sim/logging/priority")];
printlog = func(level, args...) {
if(__.dbg_types[level] >= __.log_level) { call(print, args); }
}