Skip to content

Commit

Permalink
[api] Changed timestamps, Added more levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
AvianFlu committed Oct 8, 2011
1 parent bedbb77 commit d5a89be
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/logger.js
Expand Up @@ -26,24 +26,29 @@ var Logger = exports.Logger = function (options) {
port: self.port,
username: self.username,
password: self.password
})
});
]
});

self.on('*::gotMessage', function (data) {
data.time = JSON.stringify(new Date());
data.time = new Date();
_logger.info(data);
});

self.on('*::sentMessage', function (data) {
data.time = new Date();
_logger.silly(data);
});

self.on('*::error', function (data) {
// Under hook.io 0.7.x, this would be a kohai error. bad.
data.time = JSON.stringify(new Date());
data.time = new Date();
_logger.error(data);
});

self.on('*::*::error', function (data) {
// This would be a child error. Not quite as bad.
data.time = JSON.stringify(new Date());
data.time = new Date();
_logger.warn(data);
});

Expand Down

0 comments on commit d5a89be

Please sign in to comment.