u
This commit is contained in:
parent
7c0b1bce15
commit
25a01e9bb0
14
cc.js
14
cc.js
@ -13,9 +13,9 @@ function deepStringify (args = []) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function routeNow () {
|
function fromPath () {
|
||||||
if (globalThis.process?.release?.name === 'node') {
|
if (globalThis.process?.release?.name === 'node') {
|
||||||
return {} // { _from: routeNow.caller.name } // new Error().stack?.split('\n') , .match(/at (.*?) /g)[2]
|
return {} // { _from: fromPath.caller.name } // new Error().stack?.split('\n') , .match(/at (.*?) /g)[2]
|
||||||
} else if (globalThis.uni && globalThis.UniApp) {
|
} else if (globalThis.uni && globalThis.UniApp) {
|
||||||
return { _from: globalThis.getCurrentPages?.()?.pop?.()?.route?.substring?.(6) || 'VueApp' }
|
return { _from: globalThis.getCurrentPages?.()?.pop?.()?.route?.substring?.(6) || 'VueApp' }
|
||||||
} else {
|
} else {
|
||||||
@ -39,7 +39,7 @@ module.exports =
|
|||||||
console.log(deepStringify({
|
console.log(deepStringify({
|
||||||
_at: new Date().toJSON(),
|
_at: new Date().toJSON(),
|
||||||
_type: 'CLOG', // arguments.callee.name doesn't work in nodejs strict mode
|
_type: 'CLOG', // arguments.callee.name doesn't work in nodejs strict mode
|
||||||
...routeNow(),
|
...fromPath(),
|
||||||
...expandArgs(args)
|
...expandArgs(args)
|
||||||
}))
|
}))
|
||||||
globalThis.UniApp || console.log(',')
|
globalThis.UniApp || console.log(',')
|
||||||
@ -48,7 +48,7 @@ module.exports =
|
|||||||
console.info(deepStringify({
|
console.info(deepStringify({
|
||||||
_at: new Date().toJSON(),
|
_at: new Date().toJSON(),
|
||||||
_type: 'CINFO',
|
_type: 'CINFO',
|
||||||
...routeNow(),
|
...fromPath(),
|
||||||
...expandArgs(args)
|
...expandArgs(args)
|
||||||
}))
|
}))
|
||||||
globalThis.UniApp || console.log(',')
|
globalThis.UniApp || console.log(',')
|
||||||
@ -57,7 +57,7 @@ module.exports =
|
|||||||
console.warn(deepStringify({
|
console.warn(deepStringify({
|
||||||
_at: new Date().toJSON(),
|
_at: new Date().toJSON(),
|
||||||
_type: 'CWARN',
|
_type: 'CWARN',
|
||||||
...routeNow(),
|
...fromPath(),
|
||||||
...expandArgs(args)
|
...expandArgs(args)
|
||||||
}))
|
}))
|
||||||
globalThis.UniApp || console.log(',')
|
globalThis.UniApp || console.log(',')
|
||||||
@ -66,7 +66,7 @@ module.exports =
|
|||||||
console.error(deepStringify({
|
console.error(deepStringify({
|
||||||
_at: new Date().toJSON(),
|
_at: new Date().toJSON(),
|
||||||
_type: 'CERROR',
|
_type: 'CERROR',
|
||||||
...routeNow(),
|
...fromPath(),
|
||||||
...expandArgs(args)
|
...expandArgs(args)
|
||||||
}))
|
}))
|
||||||
globalThis.UniApp || console.log(',')
|
globalThis.UniApp || console.log(',')
|
||||||
@ -76,7 +76,7 @@ module.exports =
|
|||||||
console.debug(deepStringify({
|
console.debug(deepStringify({
|
||||||
_at: new Date().toJSON(),
|
_at: new Date().toJSON(),
|
||||||
_type: 'CDEBUG',
|
_type: 'CDEBUG',
|
||||||
...routeNow(),
|
...fromPath(),
|
||||||
...expandArgs(args)
|
...expandArgs(args)
|
||||||
}))
|
}))
|
||||||
globalThis.UniApp || console.log(',')
|
globalThis.UniApp || console.log(',')
|
||||||
|
Loading…
Reference in New Issue
Block a user