![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ts.corals.io/frontend/node_modules/pusher-js/src/core/ |
import { stringify } from './utils/collections'; import Pusher from './pusher'; class Logger { debug(...args: any[]) { this.log(this.globalLog, args); } warn(...args: any[]) { this.log(this.globalLogWarn, args); } error(...args: any[]) { this.log(this.globalLogError, args); } private globalLog = (message: string) => { if (global.console && global.console.log) { global.console.log(message); } }; private globalLogWarn(message: string) { if (global.console && global.console.warn) { global.console.warn(message); } else { this.globalLog(message); } } private globalLogError(message: string) { if (global.console && global.console.error) { global.console.error(message); } else { this.globalLogWarn(message); } } private log( defaultLoggingFunction: (message: string) => void, ...args: any[] ) { var message = stringify.apply(this, arguments); if (Pusher.log) { Pusher.log(message); } else if (Pusher.logToConsole) { const log = defaultLoggingFunction.bind(this); log(message); } } } export default new Logger();