forked from CapMonsterCloud/capmonster-nodejs-captcha-solver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.ts
More file actions
17 lines (15 loc) · 669 Bytes
/
Copy pathLogger.ts
File metadata and controls
17 lines (15 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let createDebugger = (_: string) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (...args: any[]) => ({
[_]: args,
});
};
if (typeof process === 'object' && 'env' in process && process.env.DEBUG) {
// require('debug') hide require call from browser bundler, e.g. webpack
createDebugger = module[`require`].call(module, 'debug');
}
export const debugNet = createDebugger('cmc-net');
export const debugHttp = createDebugger('cmc-http');
export const debugTask = createDebugger('cmc-task');
export const debugErrorConverter = createDebugger('cmc-errconv');
export default { debugNet, debugHttp, debugTask, debugErrorConverter };