Skip to content

Commit

Permalink
Add settings to log
Browse files Browse the repository at this point in the history
  • Loading branch information
JackGruber committed Jul 19, 2021
1 parent dc76cc1 commit 27ef3d3
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,35 @@ class Backup {
}
}

private async logSettings(showDoneMsg: boolean) {
const settings = [
"path",
"singleJex",
"backupRetention",
"backupInterval",
"onlyOnChange",
"usePassword",
"lastBackup",
"fileLogLevel",
"zipArchive",
"exportPath",
"backupSetName",
"backupInfo",
];

this.log.verbose("Plugin settings:");
for (let setting of settings) {
this.log.verbose(setting + ": " + (await joplin.settings.value(setting)));
}
this.log.verbose("activeBackupPath: " + this.activeBackupPath);
this.log.verbose("backupBasePath: " + this.backupBasePath);
this.log.verbose("logFile: " + this.logFile);
this.log.verbose("showDoneMsg: " + showDoneMsg);
this.log.verbose(
"installationDir: " + (await joplin.plugins.installationDir())
);
}

public async start(showDoneMsg: boolean = false) {
if (this.backupStartTime === null) {
this.backupStartTime = new Date();
Expand All @@ -285,6 +314,8 @@ class Backup {

await this.loadSettings();

await this.logSettings(showDoneMsg);

if (this.backupBasePath === null) {
await this.showError(
"Please configure backup path in Joplin Tools > Options > Backup"
Expand Down

0 comments on commit 27ef3d3

Please sign in to comment.