From 5805cc51a66caff772614ce263eb52f356379265 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sat, 3 Nov 2018 23:19:15 +0100 Subject: [PATCH] fix(core): update --- package-lock.json | 20 ++++++++++++------ package.json | 4 ++-- ts/smartlog.classes.smartlog.ts | 37 +++++++++++++-------------------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4306a2e..e7bf8fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -157,12 +157,20 @@ "dev": true, "requires": { "@pushrocks/smartlog-interfaces": "^1.0.9" + }, + "dependencies": { + "@pushrocks/smartlog-interfaces": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-1.0.15.tgz", + "integrity": "sha512-dn9a+IhneukhtVGQG031oodOITmmQ5s5hcMThd+cMUQL3XYTbLPnZVuJfTDeWCT0iqLqrBD/qp2d1RRc3W/qIQ==", + "dev": true + } } }, "@pushrocks/smartlog-interfaces": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-1.0.9.tgz", - "integrity": "sha512-0qwpomrRN0kFjmhR9m1iHYXoISoNuXtRP0Wr+JtkYyURLwKHMaW8Xoznf8MzXJptRfqufJi3Fxh5HodpPrIZUA==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.0.tgz", + "integrity": "sha512-rk3uEp78AXLULS81SUe6YtZvyQiDImuJu/zxnIzzUFDB6ciisqtJ1qVcHYbVsW/kImeo8vBFlQyKY9/YaNgkDw==" }, "@pushrocks/smartpath": { "version": "4.0.1", @@ -251,9 +259,9 @@ } }, "@types/node": { - "version": "10.12.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.1.tgz", - "integrity": "sha512-i1sl+WCX2OCHeUi9oi7PiCNUtYFrpWhpcx878vpeq/tlZTKzcFdHePlyFHVbWqeuKN0SRPl/9ZFDSTsfv9h7VQ==", + "version": "10.12.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz", + "integrity": "sha512-53ElVDSnZeFUUFIYzI8WLQ25IhWzb6vbddNp8UHlXQyU0ET2RhV5zg0NfubzU7iNMh5bBXb0htCzfvrSVNgzaQ==", "dev": true }, "@types/vinyl": { diff --git a/package.json b/package.json index 06a01ab..a3b3b13 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,11 @@ "@gitzone/tsrun": "^1.1.13", "@gitzone/tstest": "^1.0.15", "@pushrocks/tapbundle": "^3.0.7", - "@types/node": "^10.12.1", + "@types/node": "^10.12.2", "tslint": "^5.11.0", "tslint-config-prettier": "^1.15.0" }, "dependencies": { - "@pushrocks/smartlog-interfaces": "^1.0.9" + "@pushrocks/smartlog-interfaces": "^2.0.0" } } diff --git a/ts/smartlog.classes.smartlog.ts b/ts/smartlog.classes.smartlog.ts index 5f416ae..fb2d090 100644 --- a/ts/smartlog.classes.smartlog.ts +++ b/ts/smartlog.classes.smartlog.ts @@ -1,7 +1,7 @@ import * as plugins from './smartlog.plugins'; // interfaces -import { TEnvironment, ILogContext, TLogLevel, TRuntime } from '@pushrocks/smartlog-interfaces'; +import { TLogType, TEnvironment, ILogContext, TLogLevel, TRuntime } from '@pushrocks/smartlog-interfaces'; import { LogRouter } from './smartlog.classes.logrouter'; @@ -53,32 +53,25 @@ export class Smartlog { */ public log(logLevelArg: TLogLevel, logMessageArg: string) { if (this.consoleEnabled) { - console.log(`${logLevelArg}: ${logMessageArg}`); + console.log(`LOG: ${logLevelArg}: ${logMessageArg}`); } this.logRouter.routeLog({ - logContext: this.logContext, - logLevel: logLevelArg, + type: 'log', + context: this.logContext, + level: logLevelArg, message: logMessageArg }); } - public silly(logMessageArg: string) { - this.log('silly', logMessageArg); - } - - public debug(logMessageArg) { - this.log('debug', logMessageArg); - } - - public info(logMessageArg: string) { - this.log('info', logMessageArg); - } - - public warn(logMessageArg) { - this.log('warn', logMessageArg); - } - - public error(logMessageArg) { - this.log('error', logMessageArg); + public increment(logLevelArg: TLogLevel, logMessageArg) { + if (this.consoleEnabled) { + console.log(`INCREMENT: ${logLevelArg}: ${logMessageArg}`); + } + this.logRouter.routeLog({ + type: 'increment', + context: this.logContext, + level: logLevelArg, + message: logMessageArg + }); } }