axios logs

This commit is contained in:
2023-09-23 12:21:02 +02:00
parent 575d4dc5ab
commit c3205a3e74
5 changed files with 121 additions and 74 deletions

8
src/logger.ts Normal file
View File

@@ -0,0 +1,8 @@
import log from "loglevel";
import { apply, reg } from "loglevel-plugin-prefix";
export function initLogger() {
log.setLevel(process.env.NODE_ENV === 'production' ? 'info' : 'trace');
reg(log);
apply(log, {template: '[%t] %l:'});
}