Skip to content

Commit

Permalink
Only set loglevel for specified logger if present (#1196)
Browse files Browse the repository at this point in the history
* Only set loglevel for specified logger if present

* Create hungry-rivers-push.md
  • Loading branch information
lukasIO authored Jul 16, 2024
1 parent 693e350 commit 544a7bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/hungry-rivers-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-client": patch
---

Only set loglevel for specified logger if present
7 changes: 4 additions & 3 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ export function getLogger(name: string) {
export function setLogLevel(level: LogLevel | LogLevelString, loggerName?: LoggerNames) {
if (loggerName) {
log.getLogger(loggerName).setLevel(level);
}
for (const logger of livekitLoggers) {
logger.setLevel(level);
} else {
for (const logger of livekitLoggers) {
logger.setLevel(level);
}
}
}

Expand Down

0 comments on commit 544a7bd

Please sign in to comment.