Permalink
Browse files

(new) Ensure "log" event emits JSON

  • Loading branch information...
1 parent 5348fb0 commit 9b0e0ff42763aa565400ae2a228be6bbd55b966a @indexzero indexzero committed with Alexis Sellier Feb 1, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/journey.js
View
9 lib/journey.js
@@ -219,9 +219,12 @@ journey.Router.prototype = {
if (callback) { callback(outcome) }
else { promise.emit("success", outcome) }
- promise.emit("log", new(Date)().toUTCString() +
- " -- " + request.method + " " +
- request.url.href + " - HTTP " + outcome.status);
+ promise.emit("log", {
+ date: new(Date)(),
+ method: request.method,
+ href: request.url.href,
+ outcome: outcome.status
+ });
});
});
return promise;

0 comments on commit 9b0e0ff

Please sign in to comment.