Skip to content

Commit df40d91

Browse files
committed
fix(logger.ts): fix the logger
1 parent 4387465 commit df40d91

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/utils/logger.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
import { Logger } from '@medishn/logger';
1+
import { Logger } from '@medishn/toolkit';
22

33
class Log {
44
private logger: Logger;
55

66
constructor() {
77
// Initialize the logger with the specified configuration
88
this.logger = new Logger({
9-
transports: ['console'],
9+
context: 'console',
10+
logLevels: ['warn', 'error', 'info', 'debug'],
1011
});
1112
}
1213

1314
// Warn method to log warnings
1415
warn(message: string, category?: string) {
15-
this.logger.log({ message, category, level: 'warn' });
16+
this.logger.warn({ message, category });
1617
}
1718

1819
// Error method to log errors
1920
error(message: string, category?: string) {
20-
this.logger.log({ message, category, level: 'error' });
21+
this.logger.error({ message, category });
2122
}
2223

2324
// Info method to log informational messages
2425
info(message: string, category?: string) {
25-
this.logger.log({ message, category, level: 'info' });
26+
this.logger.info({ message, category });
2627
}
2728

2829
// Debug method to log debugging messages
2930
debug(message: string, category?: string) {
30-
this.logger.log({ message, category, level: 'debug' });
31+
this.logger.debug({ message, category });
3132
}
3233
}
3334

0 commit comments

Comments
 (0)