fix(core): update

This commit is contained in:
Philipp Kunz 2018-10-31 18:51:54 +01:00
parent ade4d86597
commit 640eddae2d
2 changed files with 23 additions and 4 deletions

View File

@ -1,5 +1,14 @@
import * as plugins from './smartlog.plugins';
import { Smartlog } from './smartlog.classes.smartlog';
const defaultLogger: Smartlog = new Smartlog();
const defaultLogger: Smartlog = new Smartlog({
logContext: {
company: 'undefined',
companyunit: 'undefefined',
containerName: 'undefined',
environment: 'local',
runtime: 'node',
zone: 'undefined'
}
});
export { Smartlog, defaultLogger };

View File

@ -5,16 +5,26 @@ import { TEnvironment, ILogContext, TLogLevel, TRuntime } from '@pushrocks/smart
import { LogRouter } from './smartlog.classes.logrouter';
export interface ISmartlogContructorOptions {
logContext: ILogContext;
minimumLogLevel?: TLogLevel;
}
export class Smartlog {
private logContext: ILogContext;
private minimumLogLevel: TLogLevel;
private consoleEnabled: boolean;
private minimumLevel: TLogLevel;
private runtime: TRuntime;
public logRouter = new LogRouter();
public addLogDestination = this.logRouter.addLogDestination;
constructor(optionsArg: ISmartlogContructorOptions) {
this.logContext = optionsArg.logContext;
this.minimumLogLevel = optionsArg.minimumLogLevel;
}
// ============
// Logger Setup