Skip to content

Commit

Permalink
[api] Allow options.timestamp to be a custom function. Fixes winsto…
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Jul 24, 2011
1 parent 90190c1 commit 87e3c68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/winston/internal.js
Expand Up @@ -81,7 +81,8 @@ var clone = exports.clone = function (obj) {
// Generic logging function for returning timestamped strings
//
var log = exports.log = function (level, msg, meta, options) {
var output = options.timestamp ? timestamp() + ' - ' : '';
var prefixfn = typeof options.timestamp === 'function' ? options.timestamp : timestamp,
output = options.timestamp ? prefixfn() + ' - ' : '',
targetLevel = options.colorize ? config.colorize(level) : level,
metac = exports.clone(meta);

Expand Down

0 comments on commit 87e3c68

Please sign in to comment.