title: How do I format error logs with Winston in Node.JS?
body: <p>I have a Node.js app that it using <a href="https://github.com/winstonjs/winston" rel="noreferrer">Winston</a> for logging. I am printing my logs using <a href="https://github.com/winstonjs/winston#formats" rel="noreferrer">printf</a> like this:</p>
  <pre><code>winston.createLogger({
    level: 'debug',
    format: winston.format.combine(            
      winston.format.timestamp({ format: 'HH:mm:ss.SSSSS'}),
      winston.format.printf(log =&gt; `[${log.level}] [${log.timestamp}] ${log.message} `)
    ),
    transports: []
  });
  </code></pre>
  <p>This works fine except in the case of &quot;error&quot; logs. When a log has a log level of 'error', the log writes an entry that's formatted like this: <code>[${log.level}] [${log.timestamp}] ${log.message}${error.message}</code>. Notice, there is no space between the log message and the error message.</p>
  <p>How do I put a space between the log message and an error message if the log level is an error?</p>