forked from farpoint/meteor-winston-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.js
29 lines (26 loc) · 912 Bytes
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var log = function(level, args) {
args = Array.prototype.slice.call(args, 0),
args.splice(0, 0, level);
args.splice(0, 0, "winston-client.log");
args.push(function(error, result) {
if (error) {
throw error;
} else {
console.log(result);
}
});
Meteor.call.apply(null, args);
}
Winston = {
log: function(level) { log(level, arguments)},
silly: function() { log('silly', arguments); },
input: function() { log('input', arguments); },
verbose: function() { log('verbose', arguments); },
prompt: function() { log('prompt', arguments); },
debug: function() { log('debug', arguments); },
info: function() { log('info', arguments); },
data: function() { log('data', arguments); },
help: function() { log('help', arguments); },
warn: function() { log('warn', arguments); },
error: function() { log('error', arguments); }
};