mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
Add logger functions and move player functions to feature
This commit is contained in:
parent
adf5fc348a
commit
69f82a9427
3 changed files with 197 additions and 143 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue