mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 00:37:49 +00:00
6522ebf0ca
This version builds fine and runs all of the 14 plugins I have installed perfectly, so we're really close to having this done.
64 lines
1.2 KiB
TypeScript
64 lines
1.2 KiB
TypeScript
export const log = (name: string, ...args: any[]) => {
|
|
console.log(
|
|
`%c Decky %c ${name} %c`,
|
|
'background: #16a085; color: black;',
|
|
'background: #1abc9c; color: black;',
|
|
'background: transparent;',
|
|
...args,
|
|
);
|
|
};
|
|
|
|
export const debug = (name: string, ...args: any[]) => {
|
|
console.debug(
|
|
`%c Decky %c ${name} %c`,
|
|
'background: #16a085; color: black;',
|
|
'background: #1abc9c; color: black;',
|
|
'color: blue;',
|
|
...args,
|
|
);
|
|
};
|
|
|
|
export const warn = (name: string, ...args: any[]) => {
|
|
console.warn(
|
|
`%c Decky %c ${name} %c`,
|
|
'background: #16a085; color: black;',
|
|
'background: #ffbb00; color: black;',
|
|
'color: blue;',
|
|
...args,
|
|
);
|
|
};
|
|
|
|
export const error = (name: string, ...args: any[]) => {
|
|
console.error(
|
|
`%c Decky %c ${name} %c`,
|
|
'background: #16a085; color: black;',
|
|
'background: #FF0000;',
|
|
'background: transparent;',
|
|
...args,
|
|
);
|
|
};
|
|
|
|
class Logger {
|
|
constructor(private name: string) {
|
|
this.name = name;
|
|
}
|
|
|
|
log(...args: any[]) {
|
|
log(this.name, ...args);
|
|
}
|
|
|
|
debug(...args: any[]) {
|
|
debug(this.name, ...args);
|
|
}
|
|
|
|
warn(...args: any[]) {
|
|
warn(this.name, ...args);
|
|
}
|
|
|
|
error(...args: any[]) {
|
|
error(this.name, ...args);
|
|
}
|
|
}
|
|
|
|
export default Logger;
|