Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Commit

Permalink
Add debug to sandcastle
Browse files Browse the repository at this point in the history
  • Loading branch information
thedjpetersen committed Mar 3, 2015
1 parent ceb932d commit 4066e02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -298,6 +298,10 @@ script.on('task', function (err, taskName, options, methodName, callback) {

`refreshTimeoutOnTask` can be used to control the timeout behavior of the script executing the task. If set to true, the script will have its timeout reset when the task is completed.

Debugging
---------
Make debugging a little easier by ensuring the DEBUG environment variable includes `sandcastle`.

Contributing
---------

Expand Down
3 changes: 3 additions & 0 deletions lib/sandcastle.js
Expand Up @@ -3,6 +3,7 @@ var _ = require('lodash'),
path = require('path'),
fs = require('fs'),
os = require('os'),
debug = require('debug')('sandcastle'),
spawn = require( 'child_process' ).spawn;

var SIGHUP = os.platform()=='win32' ? 'SIGTERM' : 'SIGHUP';
Expand Down Expand Up @@ -82,11 +83,13 @@ SandCastle.prototype.spawnSandbox = function() {
// Assume that the sandbox is created once
// data is emitted on stdout.
this.sandbox.stdout.on('data', function(data) {
debug("Sandbox output: " + data.toString());
_this.waitingOnHeartbeat = false; // Used to keep only one heartbeat on the wire at a time.
_this.sandboxInitialized = true;
});

this.sandbox.stderr.on('data', function(data) {
debug("Sandbox error: " + data.toString());
_this.waitingOnHeartbeat = false;
});

Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -36,6 +36,7 @@
"dependencies": {
"bufferstream": "^0.6.2",
"clone": "^0.1.18",
"debug": "^2.1.2",
"lodash": "^2.4.1",
"optimist": "^0.3.4"
},
Expand Down

0 comments on commit 4066e02

Please sign in to comment.