Don't use sys.puts for debug in net.js
authorRyan Dahl <ry@tinyclouds.org>
Wed, 24 Mar 2010 01:10:13 +0000 (18:10 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 24 Mar 2010 01:10:13 +0000 (18:10 -0700)
lib/net.js

index 1ecc801db666ccac70f719f238e76e13787d650f..8bdece435f5ebe48091db523666672e0785a203d 100644 (file)
@@ -119,7 +119,7 @@ var timeout = new (function () {
       lists[msecs] = list;
 
       list.callback = function () {
-        sys.puts('timeout callback ' + msecs);
+        debug('timeout callback ' + msecs);
         // TODO - don't stop and start the watcher all the time.
         // just set its repeat
         var now = process.now;
@@ -128,7 +128,7 @@ var timeout = new (function () {
           var diff = now - first._idleStart;
           if (diff < msecs) {
             list.again(msecs - diff);
-            sys.puts(msecs + ' list wait');
+            debug(msecs + ' list wait');
             return;
           } else {
             remove(first);
@@ -137,7 +137,7 @@ var timeout = new (function () {
             first.forceClose(new Error('idle timeout'));
           }
         }
-        sys.puts(msecs + ' list empty');
+        debug(msecs + ' list empty');
         assert(list._idleNext == list); // list is empty
         list.stop();
       };
@@ -160,9 +160,9 @@ var timeout = new (function () {
 
       var list = lists[socket._idleTimeout];
       // if empty then stop the watcher
-      //sys.puts('unenroll');
+      //debug('unenroll');
       if (list && list._idlePrev == list) {
-        //sys.puts('unenroll: list empty');
+        //debug('unenroll: list empty');
         list.stop();
       }
     }