Permalink
Browse files

improved logger

  • Loading branch information...
1 parent 7b1f788 commit 8e7cc8ce22b0f63b3535a26a37f6b6ea2111d21d @julien51 julien51 committed Mar 21, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 modules/logger.js
View
@@ -3,7 +3,11 @@ var logger = require('winston');
// http://xmpp.org/extensions/xep-0160.html
function format_log(client, message) {
- return client.streamId + " : " + message
+ if(typeof(client.streamId) === "undefined") {
+ return [client.socket.remoteAddress, message].join(" ");
+ } else {
+ return [client.socket.remoteAddress, client.streamId, message].join(" ");
+ }
}
function Logger() {

0 comments on commit 8e7cc8c

Please sign in to comment.