Skip to content
Permalink
Browse files

[doc] Add example demonstrating how `meta` objects BECOME the `info` …

…object.
  • Loading branch information...
indexzero committed Mar 9, 2018
1 parent 1e0b96a commit fc3d603c189756d94be32fb43d72ff83b66146ab
Showing with 19 additions and 0 deletions.
  1. +19 −0 examples/metadata.js
@@ -0,0 +1,19 @@
'use strict';

const winston = require('../');

const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
winston.format(function (info, opts) {
console.log(`{ reason: ${info.reason}, promise: ${info.promise} }`);
return info;
})(),
winston.format.json()
),
transports: [
new winston.transports.Console()
]
});

logger.info('my message', { reason: 'whatever', promise: 'whenever' });

0 comments on commit fc3d603

Please sign in to comment.
You can’t perform that action at this time.