Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added extra logging info for #10.

  • Loading branch information...
commit c3289bcf7d9ffbcc7a27ee62ff893dd52a73e8d0 1 parent 28752af
@tieleman tieleman authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/server.js
View
12 lib/server.js
@@ -153,6 +153,8 @@ processProbe = function(postData, response) {
if (config['ffprobe']) {
// Do probe
+ util.log("Starting probe for: " + postData);
+
probeHandler.doProbe(postData, function(error, stdout, stderr) {
if (error !== null) {
// something went wrong
@@ -160,12 +162,15 @@ processProbe = function(postData, response) {
body['message'] = probeErrorMessage;
if (error.message) body['message'] += " " + error.message;
if (stderr) body['message'] += " " + stderr;
+ util.log("Error while probing: " + body['message']);
} else {
// everything's ok
response.statusCode = 200;
try {
+ util.log("Succesfully completed probe for: " + postData);
body['ffprobe'] = JSON.parse(stdout);
} catch(e) {
+ util.log("Error while parsing ffprobe response: " + stdout);
response.statuscode = 500;
body['message'] = probeFfprobeError;
if (stdout) body['message'] += " ffprobe output: " + stdout;
@@ -175,7 +180,7 @@ processProbe = function(postData, response) {
try {
response.end(JSON.stringify(body), 'utf8');
} catch(e) {
- util.log("Error while probing file: " + e + e.stack);
+ util.log("Error while sending probe response: " + e + e.stack);
}
});
@@ -183,11 +188,12 @@ processProbe = function(postData, response) {
// Return not supported
response.statusCode = 400;
body['message'] = probeNotSupportedMessage;
-
+ util.log("An attempt was made to probe a file, but ffprobe support was not configured.");
+
try {
response.end(JSON.stringify(body), 'utf8');
} catch(e) {
- util.log("Error while probing file: " + e + e.stack);
+ util.log("Error while sending probe response: " + e + e.stack);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.