mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Fix logger not creating log file
This commit is contained in:
parent
28abd1c1cc
commit
cd0f54a117
2 changed files with 9 additions and 0 deletions
|
|
@ -12,6 +12,14 @@ export default class Logger {
|
|||
this.logFile = normalizePath(`${vault.configDir}/${LOG_FILE_NAME}`);
|
||||
}
|
||||
|
||||
async init() {
|
||||
// Create the log file in case it doesn't exist
|
||||
if (await this.vault.adapter.exists(this.logFile)) {
|
||||
return;
|
||||
}
|
||||
this.vault.adapter.write(this.logFile, "");
|
||||
}
|
||||
|
||||
private async write(
|
||||
level: string,
|
||||
message: string,
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ export default class GitHubSyncPlugin extends Plugin {
|
|||
this.getConflictsView()?.setConflictFiles(this.conflicts);
|
||||
});
|
||||
this.logger = new Logger(this.app.vault, this.settings.enableLogging);
|
||||
this.logger.init();
|
||||
|
||||
this.addSettingTab(new GitHubSyncSettingsTab(this.app, this));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue