Skip to content

Commit aa2e4c6

Browse files
committed
Allow users to "silence" our logging
1 parent 5a0a6f6 commit aa2e4c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/logger/src/logger.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ export enum LogLevel {
3131
VERBOSE,
3232
INFO,
3333
WARN,
34-
ERROR
34+
ERROR,
35+
SILENT
3536
}
3637

3738
export type LogHandler = (type: LogLevel, level: LogLevel, ...args: any[]) => void;
3839

3940
const defaultLogHandler: LogHandler = (type: LogLevel, level: LogLevel, ...args: any[]) => {
4041
if (type < level) return;
4142
switch (type) {
43+
case LogLevel.SILENT:
44+
return;
4245
case LogLevel.VERBOSE:
4346
console.log(...args);
4447
break;

0 commit comments

Comments
 (0)