mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
refactor: version 2.0 (React)
This commit is contained in:
parent
7dad7d810a
commit
950f72d4e8
356 changed files with 7901 additions and 29547 deletions
29
packages/main/logger.ts
Normal file
29
packages/main/logger.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import styles from 'ansi-styles'
|
||||
import { app } from 'electron'
|
||||
import logger from 'electron-log'
|
||||
|
||||
const color = (hex: string, text: string) => {
|
||||
return `${styles.color.ansi(styles.hexToAnsi(hex))}${text}${
|
||||
styles.color.close
|
||||
}`
|
||||
}
|
||||
|
||||
logger.transports.console.format = `${color(
|
||||
'38bdf8',
|
||||
'[main]'
|
||||
)} {h}:{i}:{s}.{ms}{scope} › {text}`
|
||||
|
||||
logger.transports.file.level = app.isPackaged ? 'info' : 'debug'
|
||||
logger.info(
|
||||
color(
|
||||
'335eea',
|
||||
`\n\n██╗ ██╗███████╗███████╗██████╗ ██╗ █████╗ ██╗ ██╗███╗ ███╗██╗ ██╗███████╗██╗ ██████╗
|
||||
╚██╗ ██╔╝██╔════╝██╔════╝██╔══██╗██║ ██╔══██╗╚██╗ ██╔╝████╗ ████║██║ ██║██╔════╝██║██╔════╝
|
||||
╚████╔╝ █████╗ ███████╗██████╔╝██║ ███████║ ╚████╔╝ ██╔████╔██║██║ ██║███████╗██║██║
|
||||
╚██╔╝ ██╔══╝ ╚════██║██╔═══╝ ██║ ██╔══██║ ╚██╔╝ ██║╚██╔╝██║██║ ██║╚════██║██║██║
|
||||
██║ ███████╗███████║██║ ███████╗██║ ██║ ██║ ██║ ╚═╝ ██║╚██████╔╝███████║██║╚██████╗
|
||||
╚═╝ ╚══════╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝\n`
|
||||
)
|
||||
)
|
||||
|
||||
export default logger
|
||||
Loading…
Add table
Add a link
Reference in a new issue