From 2762f843fbf442bf68f6e24ece464c26ab0b570a Mon Sep 17 00:00:00 2001 From: Mangesh Patil Date: Fri, 8 Apr 2022 10:20:24 -0500 Subject: [PATCH 1/2] Pass 'audit_hash_type' option for getStream method --- daily-rotate-file.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daily-rotate-file.js b/daily-rotate-file.js index 203f189..62a6b93 100644 --- a/daily-rotate-file.js +++ b/daily-rotate-file.js @@ -91,7 +91,8 @@ var DailyRotateFile = function (options) { extension: options.extension ? options.extension : '', create_symlink: options.createSymlink ? options.createSymlink : false, symlink_name: options.symlinkName ? options.symlinkName : 'current.log', - watch_log: options.watchLog ? options.watchLog : false + watch_log: options.watchLog ? options.watchLog : false, + audit_hash_type: options.auditHashType || 'sha256' }); this.logStream.on('new', function (newFile) { From fcc42eb2ff31f5d3f9c3ee3bcba4e99709e81d6d Mon Sep 17 00:00:00 2001 From: Mangesh Patil Date: Thu, 28 Apr 2022 21:45:44 -0500 Subject: [PATCH 2/2] Addressing review comment Used Ternary operator to set option value instead of OR condition --- daily-rotate-file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daily-rotate-file.js b/daily-rotate-file.js index 62a6b93..19adc62 100644 --- a/daily-rotate-file.js +++ b/daily-rotate-file.js @@ -92,7 +92,7 @@ var DailyRotateFile = function (options) { create_symlink: options.createSymlink ? options.createSymlink : false, symlink_name: options.symlinkName ? options.symlinkName : 'current.log', watch_log: options.watchLog ? options.watchLog : false, - audit_hash_type: options.auditHashType || 'sha256' + audit_hash_type: options.auditHashType ? options.auditHashType : 'sha256' }); this.logStream.on('new', function (newFile) {