Skip to content

Commit 017bfbb

Browse files
committed
Use the Console class as default for the logger transport
1 parent 21898cc commit 017bfbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/logger/src/logger.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DEFAULT_LOG_LEVEL, LogLevelNumber, VALID_LOGGER_LEVEL_VALUES } from './
22
import { LoggerOptions, LoggerTransport, LoggerLevelValue } from './types'
33
import { generateOutput } from './output'
44
import stringify from 'json-stringify-safe'
5+
import { Console } from 'node:console'
56

67
export class Logger {
78
public baseData: Record<string, any> | null
@@ -22,7 +23,10 @@ export class Logger {
2223
if (options?.transport) {
2324
this.transport = options.transport
2425
} else {
25-
this.transport = { ...console }
26+
this.transport = new Console({
27+
stdout: process.stdout,
28+
stderr: process.stderr,
29+
})
2630
}
2731
}
2832

0 commit comments

Comments
 (0)