mirror of
https://github.com/daydreamer-json/ak-endfield-api-archive.git
synced 2026-04-07 16:12:20 +02:00
Hello
This commit is contained in:
25
src/utils/logger.ts
Normal file
25
src/utils/logger.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import log4js from 'log4js';
|
||||
import * as TypesLogLevels from '../types/LogLevels.js';
|
||||
import appConfig from './config.js';
|
||||
|
||||
log4js.configure({
|
||||
appenders: {
|
||||
System: {
|
||||
type: 'stdout',
|
||||
layout: {
|
||||
type: appConfig.logger.useCustomLayout ? 'pattern' : 'colored',
|
||||
pattern: appConfig.logger.useCustomLayout ? appConfig.logger.customLayoutPattern : '',
|
||||
},
|
||||
},
|
||||
},
|
||||
categories: {
|
||||
default: {
|
||||
appenders: ['System'],
|
||||
level: TypesLogLevels.LOG_LEVELS[appConfig.logger.logLevel],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const logger: log4js.Logger = log4js.getLogger('System');
|
||||
|
||||
export default logger;
|
||||
Reference in New Issue
Block a user