fix(core): update
This commit is contained in:
parent
c9c38368c1
commit
5805cc51a6
20
package-lock.json
generated
20
package-lock.json
generated
@ -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": {
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user