Compare commits

..

2 Commits

Author SHA1 Message Date
c9c38368c1 2.0.3 2018-10-31 18:51:54 +01:00
640eddae2d fix(core): update 2018-10-31 18:51:54 +01:00
4 changed files with 25 additions and 6 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartlog", "name": "@pushrocks/smartlog",
"version": "2.0.2", "version": "2.0.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartlog", "name": "@pushrocks/smartlog",
"version": "2.0.2", "version": "2.0.3",
"private": false, "private": false,
"description": "winston based logger for large scale projects", "description": "winston based logger for large scale projects",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -1,5 +1,14 @@
import * as plugins from './smartlog.plugins'; import * as plugins from './smartlog.plugins';
import { Smartlog } from './smartlog.classes.smartlog'; 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 }; export { Smartlog, defaultLogger };

View File

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