import * as winston from 'winston';

export const LogFormat = winston.format.combine(
  winston.format.splat(),
  winston.format.timestamp({
    format: 'YYYY-MM-DD HH:mm:ss.SSS',
  }),
  winston.format.errors({ stack: true }),
  winston.format.json(),
);

export const loggerInstance = winston.createLogger({
  level: 'info',
  transports: [
    new winston.transports.Console({
      format: LogFormat,
    }),
  ],
});
