Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[api] temporarily use a more consistent timestamp function.

  • Loading branch information...
commit bb2b6d54a118c4ab096983e91c6b5efd97c13b2d 1 parent 01d817c
Christopher Jeffrey (JJ) chjj authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 lib/winston/common.js
12 lib/winston/common.js
View
@@ -106,7 +106,9 @@ exports.clone = function (obj) {
// }
//
exports.log = function (options) {
- var timestampFn = typeof options.timestamp === 'function' ? options.timestamp : exports.timestamp,
+ var timestampFn = typeof options.timestamp === 'function'
+ ? options.timestamp
+ : exports.timestamp,
timestamp = options.timestamp ? timestampFn() : null,
meta = options.meta ? exports.clone(options.meta) : null,
output;
@@ -212,6 +214,14 @@ exports.timestamp = function () {
};
//
+// ### function timestamp ()
+// Returns a timestamp string for the current time.
+//
+exports.timestamp = function () {
+ return new Date().toISOString();
+};
+
+//
// ### function serialize (obj, key)
// #### @obj {Object|literal} Object to serialize
// #### @key {string} **Optional** Optional key represented by obj in a larger object
Please sign in to comment.
Something went wrong with that request. Please try again.