escrcpy/electron/helpers/log.js

18 lines
457 B
JavaScript
Raw Normal View History

2024-09-07 19:55:54 +02:00
import { createProxy } from '$electron/helpers/index'
import { shell } from 'electron'
import log from 'electron-log/main.js'
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()),
}