hazb_log
v1.0.0
Published
```javascript Log4hzab.openConsoleHook(); Log4hzab.setLogUploadCallBack((log) => { console.log("cb", log); sendLog(log) });
Downloads
5
Readme
Log4hzab.openConsoleHook();
Log4hzab.setLogUploadCallBack((log) => {
console.log("cb", log);
sendLog(log)
});
async function sendLog(log) {
const axiosParam = JSON.stringify(log)
}
console.log(1);
console hook success
2024-01-15T03:42:33.979Z cb 是一个普通函数 Error
at console._console.log (C:\Users\weijiadong\IdeaProjects\hazb_log\log\_console.js:9:20)
at Function.setLogUploadCallBack (C:\Users\weijiadong\IdeaProjects\hazb_log\log\log4hzab.js:44:21)
at Object.<anonymous> (C:\Users\weijiadong\IdeaProjects\hazb_log\test.js:4:10)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47
2024-01-15T03:42:33.981Z cb [
2024-01-15T03:42:33.979Z,
'cb 是一个普通函数',
'Error\n' +
' at console._console.log (C:\\Users\\weijiadong\\IdeaProjects\\hazb_log\\log\\_console.js:9:20)\n' +
' at Function.setLogUploadCallBack (C:\\Users\\weijiadong\\IdeaProjects\\hazb_log\\log\\log4hzab.js:44:21)\n' +
' at Object.<anonymous> (C:\\Users\\weijiadong\\IdeaProjects\\hazb_log\\test.js:4:10)\n' +
' at Module._compile (node:internal/modules/cjs/loader:1198:14)\n' +
' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)\n' +
' at Module.load (node:internal/modules/cjs/loader:1076:32)\n' +
' at Function.Module._load (node:internal/modules/cjs/loader:911:12)\n' +
' at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n' +
' at node:internal/main/run_main_module:22:47'
] Error
at console._console.log (C:\Users\weijiadong\IdeaProjects\hazb_log\log\_console.js:9:20)
at Function.uploadLogCb (C:\Users\weijiadong\IdeaProjects\hazb_log\test.js:5:13)
at console._console.log (C:\Users\weijiadong\IdeaProjects\hazb_log\log\_console.js:14:18)
at Function.setLogUploadCallBack (C:\Users\weijiadong\IdeaProjects\hazb_log\log\log4hzab.js:44:21)
at Object.<anonymous> (C:\Users\weijiadong\IdeaProjects\hazb_log\test.js:4:10)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2024-01-15T03:42:33.983Z 1 Error
at console._console.log (C:\Users\weijiadong\IdeaProjects\hazb_log\log\_console.js:9:20)
at Object.<anonymous> (C:\Users\weijiadong\IdeaProjects\hazb_log\test.js:7:9)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47
2024-01-15T03:42:33.983Z cb [
2024-01-15T03:42:33.983Z,
1,
'Error\n' +
' at console._console.log (C:\\Users\\weijiadong\\IdeaProjects\\hazb_log\\log\\_console.js:9:20)\n' +
' at Object.<anonymous> (C:\\Users\\weijiadong\\IdeaProjects\\hazb_log\\test.js:7:9)\n' +
' at Module._compile (node:internal/modules/cjs/loader:1198:14)\n' +
' at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)\n' +
' at Module.load (node:internal/modules/cjs/loader:1076:32)\n' +
' at Function.Module._load (node:internal/modules/cjs/loader:911:12)\n' +
' at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)\n' +
' at node:internal/main/run_main_module:22:47'
] Error
at console._console.log (C:\Users\weijiadong\IdeaProjects\hazb_log\log\_console.js:9:20)
at Function.uploadLogCb (C:\Users\weijiadong\IdeaProjects\hazb_log\test.js:5:13)
at console._console.log (C:\Users\weijiadong\IdeaProjects\hazb_log\log\_console.js:14:18)
at Object.<anonymous> (C:\Users\weijiadong\IdeaProjects\hazb_log\test.js:7:9)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47
(node:7864) Warning: Accessing non-existent property 'Log4hzab' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
后续目标:
- react useEffect Hook
- react useState Hook
- react useRef Hook
- 埋点装饰器
- 全DOM事件搜索自动埋点
- 全局异常捕获
- 日志落地
- ...