diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-07-30 16:55:59 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-07-31 09:45:24 -0300 |
| commit | 1ea19a8f216443d717c40ba1ff0713bcafe486ea (patch) | |
| tree | eaae76c3bfd3fe965f6aa754a2fc49678c40f57f /app | |
| parent | 7a466aeb2afee05cfdc5d50c46acab983d8ffae4 (diff) | |
| download | mullvadvpn-1ea19a8f216443d717c40ba1ff0713bcafe486ea.tar.xz mullvadvpn-1ea19a8f216443d717c40ba1ff0713bcafe486ea.zip | |
Don't log anything before log directory is created
Diffstat (limited to 'app')
| -rw-r--r-- | app/main.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/main.js b/app/main.js index 6e1e0bbbbc..31880248ae 100644 --- a/app/main.js +++ b/app/main.js @@ -67,6 +67,10 @@ const ApplicationMain = { // Disable log file in development log.transports.file.level = false; } else { + // Create log folder + mkdirp.sync(logDirectory); + + // Backup previous log file if it exists try { fs.accessSync(this._logFilePath); this._oldLogFilePath = path.join(logDirectory, 'frontend.old.log'); @@ -75,15 +79,13 @@ const ApplicationMain = { // No previous log file exists } + // Configure logging to file log.transports.console.level = 'debug'; log.transports.file.level = 'debug'; log.transports.file.file = this._logFilePath; - } - log.debug(`Logging to ${this._logFilePath}`); - - // create log folder - mkdirp.sync(logDirectory); + log.debug(`Logging to ${this._logFilePath}`); + } }, // Returns platform specific logs folder for application |
