fix(core): update

This commit is contained in:
2020-06-07 13:23:56 +00:00
parent 89429ac679
commit 7598e9148b
8 changed files with 134 additions and 60 deletions

View File

@ -31,9 +31,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
/**
* enables console logging
*/
public enableConsole(optionsArg?: {
captureAll: boolean;
}) {
public enableConsole(optionsArg?: { captureAll: boolean }) {
if (optionsArg && optionsArg.captureAll) {
const write = process.stdout.write;
/* import * as fs from 'fs';
@ -73,9 +71,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
}
) {
if (this.consoleEnabled) {
this.safeConsoleLog(
`${logLevelArg}: ${logMessageArg}`
);
this.safeConsoleLog(`${logLevelArg}: ${logMessageArg}`);
}
const logPackage: plugins.smartlogInterfaces.ILogPackage = {
timestamp: Date.now(),
@ -118,6 +114,8 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
}
private safeConsoleLog(logLine: string) {
console.log(`LOG => ${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()} => ${logLine}`);
console.log(
`LOG => ${new Date().getHours()}:${new Date().getMinutes()}:${new Date().getSeconds()} => ${logLine}`
);
}
}