pusher-js
Version:
Pusher JavaScript library for browser, React Native, NodeJS and web workers
28 lines (25 loc) • 616 B
text/typescript
import {stringify} from './utils/collections';
import Pusher from './pusher';
const Logger = {
debug(...args : any[]) {
if (!Pusher.log) {
return
}
Pusher.log(stringify.apply(this, arguments));
},
warn(...args : any[]) {
var message = stringify.apply(this, arguments);
const global = Function("return this")();
if (global.console) {
if (global.console.warn) {
global.console.warn(message);
} else if (global.console.log) {
global.console.log(message);
}
}
if (Pusher.log) {
Pusher.log(message);
}
}
}
export default Logger;