mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 13:00:13 +02:00
Add logger functions and move player functions to feature
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import path from 'path';
|
||||
import process from 'process';
|
||||
import { URL } from 'url';
|
||||
import log from 'electron-log/main';
|
||||
|
||||
export let resolveHtmlPath: (htmlFileName: string) => string;
|
||||
|
||||
@@ -50,3 +51,19 @@ export const hotkeyToElectronAccelerator = (hotkey: string) => {
|
||||
|
||||
return accelerator;
|
||||
};
|
||||
|
||||
const logInstance = {
|
||||
debug: log.debug,
|
||||
error: log.error,
|
||||
info: log.info,
|
||||
success: log.info,
|
||||
verbose: log.verbose,
|
||||
warning: log.warn,
|
||||
};
|
||||
|
||||
export const createLog = (data: {
|
||||
message: string;
|
||||
type: 'debug' | 'verbose' | 'success' | 'error' | 'warning' | 'info';
|
||||
}) => {
|
||||
logInstance[data.type](data.message);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user