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, "dev": true,
"requires": { "requires": {
"@pushrocks/smartlog-interfaces": "^1.0.9" "@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": { "@pushrocks/smartlog-interfaces": {
"version": "1.0.9", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-1.0.9.tgz", "resolved": "https://registry.npmjs.org/@pushrocks/smartlog-interfaces/-/smartlog-interfaces-2.0.0.tgz",
"integrity": "sha512-0qwpomrRN0kFjmhR9m1iHYXoISoNuXtRP0Wr+JtkYyURLwKHMaW8Xoznf8MzXJptRfqufJi3Fxh5HodpPrIZUA==" "integrity": "sha512-rk3uEp78AXLULS81SUe6YtZvyQiDImuJu/zxnIzzUFDB6ciisqtJ1qVcHYbVsW/kImeo8vBFlQyKY9/YaNgkDw=="
}, },
"@pushrocks/smartpath": { "@pushrocks/smartpath": {
"version": "4.0.1", "version": "4.0.1",
@ -251,9 +259,9 @@
} }
}, },
"@types/node": { "@types/node": {
"version": "10.12.1", "version": "10.12.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.2.tgz",
"integrity": "sha512-i1sl+WCX2OCHeUi9oi7PiCNUtYFrpWhpcx878vpeq/tlZTKzcFdHePlyFHVbWqeuKN0SRPl/9ZFDSTsfv9h7VQ==", "integrity": "sha512-53ElVDSnZeFUUFIYzI8WLQ25IhWzb6vbddNp8UHlXQyU0ET2RhV5zg0NfubzU7iNMh5bBXb0htCzfvrSVNgzaQ==",
"dev": true "dev": true
}, },
"@types/vinyl": { "@types/vinyl": {

View File

@ -17,11 +17,11 @@
"@gitzone/tsrun": "^1.1.13", "@gitzone/tsrun": "^1.1.13",
"@gitzone/tstest": "^1.0.15", "@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7", "@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.1", "@types/node": "^10.12.2",
"tslint": "^5.11.0", "tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0" "tslint-config-prettier": "^1.15.0"
}, },
"dependencies": { "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'; import * as plugins from './smartlog.plugins';
// interfaces // 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'; import { LogRouter } from './smartlog.classes.logrouter';
@ -53,32 +53,25 @@ export class Smartlog {
*/ */
public log(logLevelArg: TLogLevel, logMessageArg: string) { public log(logLevelArg: TLogLevel, logMessageArg: string) {
if (this.consoleEnabled) { if (this.consoleEnabled) {
console.log(`${logLevelArg}: ${logMessageArg}`); console.log(`LOG: ${logLevelArg}: ${logMessageArg}`);
} }
this.logRouter.routeLog({ this.logRouter.routeLog({
logContext: this.logContext, type: 'log',
logLevel: logLevelArg, context: this.logContext,
level: logLevelArg,
message: logMessageArg message: logMessageArg
}); });
} }
public silly(logMessageArg: string) { public increment(logLevelArg: TLogLevel, logMessageArg) {
this.log('silly', logMessageArg); if (this.consoleEnabled) {
console.log(`INCREMENT: ${logLevelArg}: ${logMessageArg}`);
} }
this.logRouter.routeLog({
public debug(logMessageArg) { type: 'increment',
this.log('debug', logMessageArg); context: this.logContext,
} level: logLevelArg,
message: logMessageArg
public info(logMessageArg: string) { });
this.log('info', logMessageArg);
}
public warn(logMessageArg) {
this.log('warn', logMessageArg);
}
public error(logMessageArg) {
this.log('error', logMessageArg);
} }
} }