From ef180da39fd456dc3f81f7afd92cc2186412bfbe Mon Sep 17 00:00:00 2001 From: Paul Sori Date: Fri, 16 Nov 2018 02:36:50 -0500 Subject: [PATCH] rename var --- docs/json_config.md | 2 +- modules/config/config-inquirer.js | 17 +++++++++++------ modules/config/configure-commander.js | 4 ++-- mstream.js | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/json_config.md b/docs/json_config.md index 4d6e38e..9c94973 100644 --- a/docs/json_config.md +++ b/docs/json_config.md @@ -7,7 +7,7 @@ Using a JSON config with mStream allows for more advanced configurations. This "port": 3030, "webAppDirectory": "public", "secret": "b6j7j5e6u5g36ubn536uyn536unm5m67u5365vby435y54ymn", - "logging": true, + "writeLogs": true, "scanOptions": { "skipImg": true, "scanInterval": 1.5, diff --git a/modules/config/config-inquirer.js b/modules/config/config-inquirer.js index 28db8aa..4bf7e9a 100644 --- a/modules/config/config-inquirer.js +++ b/modules/config/config-inquirer.js @@ -552,8 +552,8 @@ async function serverLoop(loadJson) { { name: ' * Port', value: 'editPort' }, { name: ' * SSL', value: 'ssl' }, { name: ' * Storage', value: 'storage' }, - { name: ` * Logging (${loadJson.logging ? colors.green('Enabled') : colors.red('Disabled')})`, value: 'logs' }, { name: ` * File Uploading (${loadJson.noUpload ? colors.red('Disabled') : colors.green('Enabled')})`, value: 'upload' }, + { name: ` * Write Logs to Disk (${loadJson.writeLogs ? colors.green('Enabled') : colors.red('Disabled')})`, value: 'logs' }, // { name: ' * Logs', value: 'logs' }, // TODO: // { name: ' * Save Directory', value: 'save' }, // TODO: { name: ' * Generate New Authentication Secret', value: 'editSecret' }, @@ -760,7 +760,7 @@ function editLogsDirectory(loadJson) { console.log(colors.magenta('Logs Storage')); console.log(); console.log('mStream will write all logs to this directory'); - console.log(`Logging is currently: ${loadJson.logging ? colors.green('Enabled') : colors.red('Disabled')}`) + console.log(`Writing logs to disk is currently: ${loadJson.writeLogs ? colors.green('Enabled') : colors.red('Disabled')}`) console.log(); console.log(); @@ -785,13 +785,13 @@ async function toggleLogging(loadJson) { console.log(colors.blue.bold('mStream Configuration Wizard')); console.log(colors.magenta('Logging')); console.log(); - console.log(`Logging is: ${loadJson.logging ? colors.green('Enabled') : colors.red('Disabled') }`); + console.log(`Logging is: ${loadJson.writeLogs ? colors.green('Enabled') : colors.red('Disabled') }`); console.log(`Logs will be written to: ${loadJson.storage.logsDirectory ? loadJson.storage.logsDirectory : defaults.storage.logsDirectory}`); console.log(); - const shouldFlip = await confirmThis(`Do you want to ${loadJson.logging ? colors.red('DISABLE') : colors.green('ENABLE') } logging?`); + const shouldFlip = await confirmThis(`Do you want to ${loadJson.writeLogs ? colors.red('DISABLE') : colors.green('ENABLE') } logging?`); if (shouldFlip) { - loadJson.logging = !loadJson.logging; + loadJson.writeLogs = !loadJson.writeLogs; } } @@ -1076,7 +1076,7 @@ async function fileScanLoop(loadJson) { new inquirer.Separator(), { name: ' * Pause Between Files', value: 'dbpause' }, { name: ' * Scan Interval', value: 'interval' }, - { name: ' * Boot Scan Pause', value: 'bootpause' }, + { name: ' * Boot Scan Delay', value: 'bootpause' }, { name: ' * Skip Image Scan', value: 'skipimg' }, { name: ' * Save Interval', value: 'saveinterval' } ] @@ -1111,6 +1111,11 @@ function skipImg() { } function setSaveInterval() { + console.clear(); + console.log(); + console.log(colors.blue.bold('mStream Configuration Wizard')); + console.log(colors.magenta('DB Save Interval')); + console.log(); console.log(colors.yellow('Sets how often a DB update should happen during a file scan')); console.log('Large libraries (4TB+) can see some performance gains during scan by increasing this'); console.log(); diff --git a/modules/config/configure-commander.js b/modules/config/configure-commander.js index 51ce517..44846f3 100644 --- a/modules/config/configure-commander.js +++ b/modules/config/configure-commander.js @@ -40,7 +40,7 @@ exports.setup = function (args) { .option('-P, --dbpause ', 'Specify File Scan Pause Interval (in Milliseconds)', /^\d+$/i, 0) // Logs - .option('-L, --logs ', 'Specify Database Filepath') + .option('-L, --logs', 'Enable Write Logs To Disk') // JSON config .option('-j, --json ', 'Specify JSON Boot File') @@ -177,7 +177,7 @@ exports.setup = function (args) { // Logs if (program.logs) { - program3.logs = { path: program.logs }; + program3.writeLogs = true; } return program3; diff --git a/mstream.js b/mstream.js index 44884b9..fa7b9f6 100755 --- a/mstream.js +++ b/mstream.js @@ -25,7 +25,7 @@ exports.serveit = function (program) { defaults.setup(program); // Logging - if (program.logging) { + if (program.writeLogs) { logger.addFileLogger(program.storage.logsDirectory); }