forked from FOSS/BangleApps
sleeplog: Fix to be able to switch logging as intended
Update lib.js - fix error in `setEnabled(...)` when logfile=false Update settings.js - use correct value for settings.logfilemaster
parent
f9be0db3c8
commit
ab42b6555f
|
@ -5,9 +5,8 @@ exports = {
|
|||
if (typeof global.sleeplog !== "object") return;
|
||||
|
||||
// set default logfile
|
||||
logfile = logfile.endsWith(".log") ? logfile :
|
||||
logfile === false ? undefined :
|
||||
"sleeplog.log";
|
||||
logfile = (typeof logfile === "string" && logfile.endsWith(".log")) ? logfile :
|
||||
logfile === false ? undefined : "sleeplog.log";
|
||||
|
||||
// stop if enabled
|
||||
if (global.sleeplog.enabled) global.sleeplog.stop();
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
format: v => v === true ? "default" : v ? "custom" : "off",
|
||||
onchange: function(v) {
|
||||
if (v !== "custom") {
|
||||
settings.logfile = v ? "sleeplog.log" : undefined;
|
||||
settings.logfile = v ? "sleeplog.log" : false;
|
||||
changeRestart();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue