Add some logging

This commit is contained in:
Bryan Ashby 2018-01-09 18:43:04 -07:00
parent 99244aa2e4
commit c4c30e0c0d
1 changed files with 12 additions and 0 deletions

View File

@ -284,6 +284,8 @@ class FileAreaWebAccess {
routeWebRequest(req, resp) {
const hashId = paths.basename(req.url);
Log.debug( { hashId : hashId, url : req.url }, 'File area web request');
this.loadServedHashId(hashId, (err, servedItem) => {
if(err) {
@ -305,6 +307,8 @@ class FileAreaWebAccess {
}
routeWebRequestForSingleFile(servedItem, req, resp) {
Log.debug( { servedItem : servedItem }, 'Single file web request');
const fileEntry = new FileEntry();
servedItem.fileId = servedItem.fileIds[0];
@ -348,6 +352,8 @@ class FileAreaWebAccess {
}
routeWebRequestForBatchArchive(servedItem, req, resp) {
Log.debug( { servedItem : servedItem }, 'Batch file web request');
//
// We are going to build an on-the-fly zip file stream of 1:n
// files in the batch.
@ -392,8 +398,14 @@ class FileAreaWebAccess {
});
},
function createAndServeStream(filePaths, callback) {
Log.trace( { filePaths : filePaths }, 'Creating zip archive for batch web request');
const zipFile = new yazl.ZipFile();
zipFile.on('error', err => {
Log.warn( { error : err.message }, 'Error adding file to batch web request archive');
});
filePaths.forEach(fp => {
zipFile.addFile(
fp, // path to physical file