Skip to content

Commit 087fec7

Browse files
added logs
1 parent 673003a commit 087fec7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/tunnel.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function Tunnel() {
4848
}
4949
// Configure logger
5050
Config_(options, function(error, response) {
51+
console.log("Current version of Node Tunnel: ", packageVersion)
5152
if (error) {
5253
throw new Error(error);
5354
}
@@ -118,6 +119,7 @@ function Tunnel() {
118119

119120
// Configure looger
120121
Config_(options, function(error, response) {
122+
console.log("Current version of Node Tunnel: ", packageVersion)
121123
if (error) {
122124
throw new Error(error);
123125
}
@@ -312,7 +314,9 @@ function runBinary_(self, retries, fnCallback) {
312314
);
313315
}
314316
// Run Binary with argumants in spawn process.
315-
self.proc = childProcess.spawn(self.binaryPath, binaryArguments);
317+
self.proc = childProcess.spawn(self.binaryPath, binaryArguments, {
318+
detached: true
319+
});
316320
var isCallback = false;
317321
self.proc.stdout.pipe(split()).on('data', function(data) {
318322
if (!isCallback) {

lib/tunnel_binary.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ function TunnelBinary(httpTunnelConfig, options) {
141141
fs.createReadStream(binaryPath)
142142
.pipe(unzip.Extract({ path: destParentDir }))
143143
.on('error', function(e) {
144+
console.log("Error log ------> ", e);
144145
logger.log(
145146
conf['user'],
146147
conf['key'],
@@ -185,7 +186,7 @@ function TunnelBinary(httpTunnelConfig, options) {
185186
self.retryBinaryDownload_(conf, destParentDir, retries, binaryPath, fnCallback);
186187
});
187188
} catch (e) {
188-
console.error('Got Error while downloading binary zip');
189+
console.error('Got Error while downloading binary zip', e);
189190
logger.log(conf['user'], conf['key'], { filename: __filename }, conf, {
190191
message: 'Got Error while Extracting binary zip',
191192
e: e
@@ -254,6 +255,7 @@ function TunnelBinary(httpTunnelConfig, options) {
254255
fs.accessSync(path, mode);
255256
return true;
256257
} catch (e) {
258+
console.log('Error checkPath ----->', e);
257259
if (typeof fs.accessSync !== 'undefined') {
258260
return false;
259261
}

0 commit comments

Comments
 (0)