🐛 Fix: some bugs will case picgo-gui-local.log too large

ISSUES CLOSED: #995
This commit is contained in:
PiEgg
2022-10-23 15:47:11 +08:00
parent 9791ff24d8
commit 012a01d5d9
2 changed files with 21 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
import path from 'path'
import { dbPathDir } from 'apis/core/datastore/dbChecker'
import { app } from 'electron'
import { getLogger } from 'apis/core/utils/localLogger'
const STORE_PATH = dbPathDir()
const STORE_PATH = app.getPath('userData')
const LOG_PATH = path.join(STORE_PATH, 'picgo-gui-local.log')
const logger = getLogger(LOG_PATH)
@@ -10,7 +10,6 @@ const logger = getLogger(LOG_PATH)
// so we can't use the log from picgo
const handleProcessError = (error: Error) => {
console.error(error)
logger('error', error)
}