fix(core): update

This commit is contained in:
Philipp Kunz 2018-11-03 23:19:15 +01:00
parent c9c38368c1
commit 5805cc51a6
3 changed files with 31 additions and 30 deletions

20
package-lock.json generated
View File

@ -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": {

View File

@ -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"
}
}

View File

@ -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 increment(logLevelArg: TLogLevel, logMessageArg) {
if (this.consoleEnabled) {
console.log(`INCREMENT: ${logLevelArg}: ${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);
this.logRouter.routeLog({
type: 'increment',
context: this.logContext,
level: logLevelArg,
message: logMessageArg
});
}
}