Skip to content

Commit

Permalink
[doc] Added simple string interpolation examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Oct 29, 2015
1 parent b38590d commit 1581aa5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/interpolation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var w = require('./');

w.info('Found %s at %s', 'error', new Date());
w.info('Found %s at %s', 'error', new Error('chill winston'));
w.info('Found %s at %s', 'error', /WUT/);
w.info('Found %s at %s', 'error', true);
w.info('Found %s at %s', 'error', 100.00);
w.info('Found %s at %s', 'error', ['1, 2, 3']);
// prints "Found error at %s"

// console.log('Found %s at %s', 'error', new Date())
// prints "Found error at Tue Jan 20 2015 10:14:26 GMT-0800 (PST)"

0 comments on commit 1581aa5

Please sign in to comment.