Allow mingling of DiskDump logConsole() output with the web server's log

This commit is contained in:
Jeff Parsons 2014-10-28 22:09:13 -07:00 committed by jeffpar
commit ef4c043fab
6 changed files with 878 additions and 818 deletions

View file

@ -657,6 +657,7 @@ HTMLOut.setOptions = function(options)
}
if (options['logfile'] !== undefined) {
logFile = options['logfile'];
HTTPAPI.setLogFile(logFile);
}
if (options['rebuild'] !== undefined) {
fRebuild = options['rebuild'];

View file

@ -64,6 +64,11 @@ var HTMLOut;
*/
var sServerRoot = "";
/*
* logFile is set by HTMLOut, allowing us to "mingle" our output with the server's log (typically "./logs/node.log").
*/
var logFile = null;
/*
* Entries in this table are matched first, as-is, to req.path (no string or RegExp compare involved);
* we do, however, strip any trailing slash from the incoming path before doing the lookup, so none of
@ -140,6 +145,16 @@ function HTTPAPI(out, sRoot) {
sServerRoot = sRoot;
}
/**
* setLogFile(file)
*
* @param {Object} file
*/
HTTPAPI.setLogFile = function(file) {
logFile = file;
DiskDump.setLogFile(file);
};
/**
* @class Volume
* @property {number|null} fd file descriptor