Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

Commit

Permalink
fix: logger upgrade issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mentos1386 committed Jul 7, 2018
1 parent a167911 commit ed6b368
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/modules/core/logger/logger.providers.ts
@@ -1,6 +1,5 @@
import { LOGGER_WINSTON_PROVIDER } from './logger.constants';
import { Logger, transports } from 'winston';

import { transports, createLogger } from 'winston';

export const loggerProviders = [
{
Expand All @@ -9,13 +8,10 @@ export const loggerProviders = [
const LOG_LEVEL = process.env.LOG_LEVEL;

const winstonTransports = [
new transports.Console({
colorize: true,
align: true,
}),
new transports.Console({}),
];

return new Logger({
return createLogger({
level: LOG_LEVEL,
transports: winstonTransports,
});
Expand Down
4 changes: 2 additions & 2 deletions src/modules/core/logger/logger.service.ts
@@ -1,11 +1,11 @@
import { LoggerInstance } from 'winston';
import { Injectable, Inject } from '@nestjs/common';
import { LOGGER_LEVEL, LOGGER_WINSTON_PROVIDER } from './logger.constants';
import { Logger } from 'winston';

@Injectable()
export class LoggerService {

constructor(@Inject(LOGGER_WINSTON_PROVIDER) private winston: LoggerInstance) {
constructor(@Inject(LOGGER_WINSTON_PROVIDER) private winston: Logger) {
}

public log(level: LOGGER_LEVEL, msg: string, ...meta): void {
Expand Down

0 comments on commit ed6b368

Please sign in to comment.