Skip to content

Commit

Permalink
More consistent logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cramforce committed Oct 10, 2010
1 parent 342ea30 commit df88d01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/twitter-stream-client.js
Expand Up @@ -10,10 +10,10 @@ function listen(url, requester, cb) {

var index = conIndex++;

console.log("Stream connect to "+url);
console.log("[Stream] connect to "+url);
requester(url, "GET", function (error, request) {
if(error) {
console.log("Stream Connection Error "+error);
console.log("[Stream] Connection Error "+error);
cb({
connection: "close"
});
Expand All @@ -27,7 +27,7 @@ function listen(url, requester, cb) {
statusCode: response.statusCode
});
}
console.log('HEADERS: ' + JSON.stringify(response.headers));
console.log('[Stream] HEADERS: ' + JSON.stringify(response.headers));
response.setEncoding('utf8');

response.on('end', function () {
Expand Down Expand Up @@ -63,9 +63,9 @@ function listen(url, requester, cb) {
if(response) {
try {
response.connection.destroy();
console.log("Closed connection "+index);
console.log("[Stream] Closed connection "+index);
} catch(e) {
console.log("Error ending connection "+e)
console.log("[Stream] Error ending connection "+e)
}
}
}
Expand Down

0 comments on commit df88d01

Please sign in to comment.