axios logs
This commit is contained in:
8
src/logger.ts
Normal file
8
src/logger.ts
Normal 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:'});
|
||||
}
|
||||
Reference in New Issue
Block a user