mirror of
https://github.com/zadam/trilium.git
synced 2026-02-27 09:03:36 +01:00
27 lines
462 B
TypeScript
27 lines
462 B
TypeScript
export default class LogService {
|
|
|
|
log(message: string | Error) {
|
|
console.log(message);
|
|
}
|
|
|
|
info(message: string | Error) {
|
|
this.log(message);
|
|
}
|
|
|
|
error(message: string | Error | unknown) {
|
|
this.log(`ERROR: ${message}`);
|
|
}
|
|
|
|
}
|
|
|
|
let log: LogService;
|
|
|
|
export function initLog() {
|
|
log = new LogService();
|
|
}
|
|
|
|
export function getLog() {
|
|
if (!log) throw new Error("Log service not initialized.");
|
|
return log;
|
|
}
|