escrcpy/electron/helpers/log.js
2024-03-13 11:03:50 +08:00

18 lines
454 B
JavaScript

import { shell } from 'electron'
import log from 'electron-log/main'
import { createProxy } from '@electron/helpers/index'
log.transports.console.level = false
const levels = Object.keys(log.functions)
const getFilePath = () => log.transports.file.getFile()?.path
export default {
...createProxy(log, ['initialize', ...levels]),
levels,
functions: createProxy(log, levels),
getFilePath,
openInEditor: () => shell.openPath(getFilePath()),
}