Mercurial > pub > ImplabJs
comparison src/implab/log/listeners/console.js @ 24:f750c89976d3
Added trace tools, implab/log/trace!<channel-name>, <channel-name> is optional
author | cin |
---|---|
date | Thu, 07 Dec 2017 19:19:29 +0300 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
23:1d72fddc319a | 24:f750c89976d3 |
---|---|
1 define([], function () { | |
2 if (console && console.log) | |
3 return function (ch, name, msg) { | |
4 | |
5 var args = [ch + ":"]; | |
6 | |
7 switch (name) { | |
8 case "warn": | |
9 case "error": | |
10 case "log": | |
11 break; | |
12 default: | |
13 args.push(name + ":"); | |
14 name = "log"; | |
15 } | |
16 | |
17 | |
18 if (msg instanceof Array) | |
19 args.push.apply(args, msg); | |
20 else | |
21 args.push(msg); | |
22 | |
23 console[name].apply(console, args); | |
24 }; | |
25 }); |