message: Logger to work with multiple params + print stack trace
diff: +import util from 'util'
  import { createLogger as winstonCreateLogger, format, LoggerOptions, transports } from 'winston'
  +import { TransformableInfo } from 'logform'
  const { colorize, combine, printf, json, timestamp } = format
  const consoleFormat = printf(({ level, message, timestamp, handlerId }) => {
  return `${timestamp} ${handlerId ? 'event' : 'runtime'} ${level} ${message}`
  })
  +const consoleLikeMessage = format((data: TransformableInfo) => {
  + // @ts-ignore
  + const args = data[Symbol.for('splat')]
  + // @ts-ignore
  + const strArgs = util.format(...args)
  + const brIfNeeded = args && args.length && args[0].stack ? '\n ' : ' '
  + return {
  + ...data,
  + message: `${data.message.trim()}${brIfNeeded}${strArgs}`,
  + }
  +})
  +
  const loggerOptions = {
  level: 'info',
  - format: combine(timestamp(), json()),
  + format: combine(consoleLikeMessage(), timestamp(), json()),
  exitOnError: false,
  transports: [
  // - Write all logs with level `error` to `error.log`
  - new transports.File({ filename: './logs/error.log', level: 'error' }),
  + new transports.File({
  + filename: './logs/error.log',
  + level: 'error',
  + }),
  // - Write all logs to `combined.log`
  - new transports.File({ filename: './logs/combined.log' }),
  + new transports.File({
  + filename: './logs/combined.log',
  + }),
  new transports.Console({
  format: combine(colorize({ level: true, message: true }), consoleFormat),
  }),
  ],
  }
  -const createLogger = (options: LoggerOptions = loggerOptions) => winstonCreateLogger(options)
  +const createLogger = (options: LoggerOptions = loggerOptions) => {
  + const logger = winstonCreateLogger(options)
  +
  + const levels = ['debug', 'info', 'error', 'warn', 'debug']
  + // Print stacktrace for Errors
  + levels.forEach((level) => {
  + // @ts-ignore
  + logger[level] = (msg: any, ...remains: any) => {
  + if (typeof msg != 'string') {
  + return logger.log(level, '', msg, ...remains)
  + }
  +
  + logger.log(level, msg, ...remains)
  + }
  + })
  +
  + return logger
  +}
  export { createLogger }
  