import { StorageType } from './Storage';
import type { WorkerChoiceStrategy } from 'poolifier';
import { WorkerProcessType } from './Worker';
+import { level } from 'winston';
export interface StationTemplateUrl {
file: string;
chargingStationsPerWorker?: number;
logStatisticsInterval?: number;
logFormat?: string;
- logLevel?: string;
+ logLevel?: level;
logRotate?: boolean;
logMaxFiles?: number;
logFile?: string;
import { WorkerProcessType } from '../types/Worker';
import chalk from 'chalk';
import fs from 'fs';
+import { level } from 'winston';
import path from 'path';
export default class Configuration {
return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'logMaxFiles') ? Configuration.getConfig().logMaxFiles : 7;
}
- static getLogLevel(): string {
- return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'logLevel') ? Configuration.getConfig().logLevel : 'info';
+ static getLogLevel(): level {
+ return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'logLevel') ? Configuration.getConfig().logLevel.toLowerCase() as level : 'info';
}
static getLogFile(): string {
}
const logger: Logger = createLogger({
- level: Configuration.getLogLevel().toLowerCase(),
+ level: Configuration.getLogLevel(),
format: format.combine(format.splat(), format[Configuration.getLogFormat()]()),
transports: transports,
});