Permalink
Browse files

Fixup logging.

  • Loading branch information...
1 parent e6ba5f3 commit 0d3a5a94c4c783f55e8c8c9b712b1b866a76b2e1 @epeli committed Jun 20, 2011
Showing with 10 additions and 9 deletions.
  1. +2 −4 lib/main.coffee
  2. +8 −4 lib/web/clientscripts/main.coffee
  3. +0 −1 lib/web/server.coffee
View
6 lib/main.coffee
@@ -10,7 +10,7 @@ findit = require "findit"
iniparser = require "iniparser"
-port = 8080
+port = 5678
class Watcher extends EventEmitter
@@ -78,9 +78,9 @@ class Watcher extends EventEmitter
details http://localhost:#{ port }/##{ id }"""
@exitstatus = err.code
else
+ console.log "\nRan", @name, "successfully!\n", (new Date) + 2*60*60
@exitstatus = 0
- console.log @name, "Emitting", @exitstatus
@emit "end", @exitstatus
@@ -89,8 +89,6 @@ class Watcher extends EventEmitter
console.log "Rerunning '#{ @name }'"
@rerun = false
@runCMD()
- else
- console.log "\nRan", @name, "successfully!", (new Date) + 2*60*60
cmd.stdout.on "data", (data) =>
View
12 lib/web/clientscripts/main.coffee
@@ -25,13 +25,14 @@ class WatcherRemote extends JQEvenEmitter
@update options
remote = now[@name] = {}
- remote.sendStdout = (data) =>
+
+ remote.sendStdout = (data) =>
@stdout += data
@emit "update"
- remote.sendStderr = (data) =>
+ remote.sendStderr = (data) =>
@stderr += data
@emit "update"
- remote.sendStdboth = (data) =>
+ remote.sendStdboth = (data) =>
@stdboth += data
@emit "update"
@@ -40,6 +41,8 @@ class WatcherRemote extends JQEvenEmitter
@emit "update"
remote.sendExitStatus = (exitstatus) =>
+ # Emits update
+ console.log "Got exitstatus from server", exitstatus
@setStatus exitstatus
@@ -151,7 +154,8 @@ class Notifies
manager = new WatcherManager
-now.init = (watchers) ->
+
+now.init = (watchers, cb) ->
$ ->
for w in watchers
manager.createWatcher w
View
1 lib/web/server.coffee
@@ -51,7 +51,6 @@ exports.registerWatcher = (watcher) ->
watchers[watcher.name] = watcher
watcher.on "stdout", (data) ->
- console.log "SENDING", watcher.name
everyone.now[watcher.name]?.sendStdout(data)
watcher.on "stderr", (data) ->
everyone.now[watcher.name]?.sendStderr(data)

0 comments on commit 0d3a5a9

Please sign in to comment.