timer-logs
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -71,2 +71,3 @@ import * as crypto from 'crypto' | ||
this.uniqueId = crypto.randomBytes(8).toString('hex') | ||
this.start('operationTime') | ||
this.start(this.config.label) | ||
@@ -151,2 +152,3 @@ } | ||
this.finishTime = Date.now() | ||
this.stop('operationTime') | ||
if (this.mostRecentlyStartedLabel && !this.savedTimes[this.mostRecentlyStartedLabel].finishTime) this.end() | ||
@@ -216,2 +218,3 @@ const printObject: { [label: string]: string | number } = { | ||
const errorDetails = new Map(Object.entries(e)) | ||
if(!errorDetails.has('message')) errorDetails.set('message', 'Postgres error code '+e.code) | ||
errorDetails.set("databaseType", "postgres") | ||
@@ -290,2 +293,6 @@ this.printLog(errorDetails, Severity.ERROR) | ||
private printLog(details: Map<string, string | number | boolean | null | undefined>, severity: Severity) { | ||
if(!details.has('message')){ | ||
// this should never be triggered. Always pass a message in the details map. Just a backup: | ||
details.set('message', 'timer-logs unset message in file '+this.config.filename) | ||
} | ||
const log: { [label: string]: string | number | boolean | null | undefined } = { | ||
@@ -292,0 +299,0 @@ severity: severity, |
{ | ||
"name": "timer-logs", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "@types/node": "^15.00.0" |
Sorry, the diff of this file is not supported yet
55154
1054