You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
553 B
36 lines
553 B
var logger = { |
|
TRACE: 0, |
|
INFO: 1, |
|
WARN: 2, |
|
ERROR: 3, |
|
level: 0, |
|
logPrefix: "", |
|
|
|
trace: function(message){ |
|
if(this.level <= this.TRACE){ |
|
this._print(message); |
|
} |
|
}, |
|
|
|
info: function(message){ |
|
if(this.level <= this.INFO){ |
|
this._print(message); |
|
} |
|
}, |
|
|
|
warn: function(message){ |
|
if(this.level <= this.WARN){ |
|
this._print(message); |
|
} |
|
}, |
|
|
|
error: function(message){ |
|
if(this.level <= this.ERROR){ |
|
this._print(message); |
|
} |
|
}, |
|
|
|
_print: function(message){ |
|
print((this.logPrefix ? (this.logPrefix + " ") : "") + message); |
|
} |
|
}
|
|
|