Skip to content

Commit

Permalink
fix: setLogLevel does not take effect on the log printed during init #…
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed Nov 25, 2024
1 parent d2d0c01 commit 3cc3cc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-shrimps-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@webav/internal-utils': patch
---

fix: setLogLevel does not take effect on the log printed during init #329
8 changes: 5 additions & 3 deletions packages/internal-utils/src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ map.set(Log.error, 3);

declare const PKG_VERSION: string;

(function init() {
(async function init() {
await Promise.resolve();
if (globalThis.navigator == null) return;
Log.info(`@webav version: ${PKG_VERSION}`);
Log.info(
`@webav version: ${PKG_VERSION}, date: ${new Date().toLocaleDateString()}`,
);
Log.info(globalThis.navigator.userAgent);
Log.info('date: ' + new Date().toLocaleDateString());
})();

if (import.meta.env?.DEV) {
Expand Down

0 comments on commit 3cc3cc7

Please sign in to comment.