mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-22 02:12:30 +01:00
always log to console
and also allow opening log path
This commit is contained in:
parent
ba9c098941
commit
f31d08981e
@ -29,9 +29,10 @@ const createLogger = () => winston.createLogger({
|
||||
});
|
||||
|
||||
const logDirPath = app.isPackaged ? app.getPath('userData') : '.';
|
||||
export const logFilePath = join(logDirPath, 'app.log');
|
||||
|
||||
const logger = createLogger();
|
||||
logger.add(new winston.transports.File({ level: 'debug', filename: join(logDirPath, 'app.log'), options: { flags: 'a' } }));
|
||||
if (!app.isPackaged) logger.add(new winston.transports.Console());
|
||||
logger.add(new winston.transports.Console());
|
||||
logger.add(new winston.transports.File({ level: 'debug', filename: logFilePath, options: { flags: 'a' }, maxsize: 1e6, maxFiles: 100, tailable: true }));
|
||||
|
||||
export default logger;
|
||||
|
@ -3,6 +3,7 @@ import electron, { BrowserWindow } from 'electron';
|
||||
import { t } from 'i18next';
|
||||
|
||||
import { homepage, getReleaseUrl, licensesPage } from './constants.js';
|
||||
import { logFilePath } from './logger.js';
|
||||
|
||||
|
||||
// menu-safe i18n.t:
|
||||
@ -424,6 +425,11 @@ export default ({ app, mainWindow, newVersion, isStoreBuild }: {
|
||||
click() { electron.shell.openExternal('https://github.com/mifi/lossless-cut/issues'); },
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: esc(t('Log file')),
|
||||
click() { electron.shell.openPath(logFilePath); },
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
label: esc(t('Licenses')),
|
||||
click() { electron.shell.openExternal(licensesPage); },
|
||||
|
Loading…
Reference in New Issue
Block a user