This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
TyperLog/lib/TyperLog/TyperLog.ts
2014-03-06 15:11:01 -06:00

30 lines
893 B
TypeScript

module TyperLog {
export class TyperLog {
private static logLevel:TyperLogLevel = TyperLogLevel.WARNING;
private static console = (()=>{
var noop = ()=>{};
var console:{} = window.console || {};
console["log"] = window.console.log || noop;
console["trace"] = ()=> {
try {
//noinspection ExceptionCaughtLocallyJS
throw {};
} catch(e) {
console["log"](e.trace);
}
};
console["debug"] = window.console.debug || noop;
return console;
})();
public static Log(message:string, level:TyperLogLevel, category:string = "") {
if (level <= this.logLevel) {
TyperLog.console["log"](message);
}
}
private static
}
}