diff --git a/packages/uni-shared/dist/uni-shared.cjs.js b/packages/uni-shared/dist/uni-shared.cjs.js index e64af96c29338cda6d6207910af97f64710027bb..31f1eb1b04476a647d6a0b2fddfdfd62fde98f6b 100644 --- a/packages/uni-shared/dist/uni-shared.cjs.js +++ b/packages/uni-shared/dist/uni-shared.cjs.js @@ -656,7 +656,13 @@ function parseUrl(url) { function formatAppLog(type, filename, ...args) { // @ts-ignore - uni.__log__ && uni.__log__(type, filename, ...args); + if (uni.__log__) { + // @ts-ignore + uni.__log__(type, filename, ...args); + } + else { + console[type].apply(console, [...args, filename]); + } } function formatH5Log(type, filename, ...args) { console[type].apply(console, [...args, filename]); diff --git a/packages/uni-shared/dist/uni-shared.es.js b/packages/uni-shared/dist/uni-shared.es.js index b0f4eadc92d3d2273556a9df246263a7d6a8e13d..29b8053152cddd480a6b8fca324a8105eeaf4e4d 100644 --- a/packages/uni-shared/dist/uni-shared.es.js +++ b/packages/uni-shared/dist/uni-shared.es.js @@ -652,7 +652,13 @@ function parseUrl(url) { function formatAppLog(type, filename, ...args) { // @ts-ignore - uni.__log__ && uni.__log__(type, filename, ...args); + if (uni.__log__) { + // @ts-ignore + uni.__log__(type, filename, ...args); + } + else { + console[type].apply(console, [...args, filename]); + } } function formatH5Log(type, filename, ...args) { console[type].apply(console, [...args, filename]); diff --git a/packages/uni-shared/src/hbx/formatLog.ts b/packages/uni-shared/src/hbx/formatLog.ts index cb147b43d2dcba980c6e6b5f858cbbc2a5f20196..ad35ab0bfd1be18fda0f3765e818ce7e96e7f5df 100644 --- a/packages/uni-shared/src/hbx/formatLog.ts +++ b/packages/uni-shared/src/hbx/formatLog.ts @@ -4,7 +4,12 @@ export function formatAppLog( ...args: unknown[] ) { // @ts-ignore - uni.__log__ && uni.__log__(type, filename, ...args) + if (uni.__log__) { + // @ts-ignore + uni.__log__(type, filename, ...args) + } else { + ;(console[type] as Function).apply(console, [...args, filename]) + } } export function formatH5Log(