@serverless-guru/logger
Advanced tools
Comparing version
@@ -7,2 +7,3 @@ import { MetricUnitList } from "./constants"; | ||
private correlationId; | ||
private resetCorrelationId; | ||
private applicationName; | ||
@@ -9,0 +10,0 @@ private persistentContext; |
@@ -19,2 +19,3 @@ "use strict"; | ||
correlationId; | ||
resetCorrelationId; | ||
applicationName; | ||
@@ -26,2 +27,3 @@ persistentContext; | ||
this.correlationId = correlationId ? correlationId : (0, node_crypto_1.randomUUID)(); | ||
this.resetCorrelationId = correlationId ? false : true; | ||
this.applicationName = applicationName; | ||
@@ -47,5 +49,3 @@ this.persistentContext = {}; | ||
if (Array.isArray(array)) { | ||
return array | ||
.filter((el) => typeof el === "string") | ||
.map((el) => el.toLowerCase()); | ||
return array.filter((el) => typeof el === "string").map((el) => el.toLowerCase()); | ||
} | ||
@@ -205,2 +205,3 @@ return []; | ||
this.correlationId = correlationId; | ||
this.resetCorrelationId = true; | ||
} | ||
@@ -218,5 +219,5 @@ } | ||
this.persistentContext = {}; | ||
this.correlationId = ""; | ||
this.applicationName = ""; | ||
this.serviceName = ""; | ||
if (this.resetCorrelationId) { | ||
this.correlationId = (0, node_crypto_1.randomUUID)(); | ||
} | ||
} | ||
@@ -223,0 +224,0 @@ metric(activity, meta) { |
@@ -7,2 +7,3 @@ import { MetricUnitList } from "./constants"; | ||
private correlationId; | ||
private resetCorrelationId; | ||
private applicationName; | ||
@@ -9,0 +10,0 @@ private persistentContext; |
@@ -16,2 +16,3 @@ import { randomUUID } from "node:crypto"; | ||
correlationId; | ||
resetCorrelationId; | ||
applicationName; | ||
@@ -23,2 +24,3 @@ persistentContext; | ||
this.correlationId = correlationId ? correlationId : randomUUID(); | ||
this.resetCorrelationId = correlationId ? false : true; | ||
this.applicationName = applicationName; | ||
@@ -44,5 +46,3 @@ this.persistentContext = {}; | ||
if (Array.isArray(array)) { | ||
return array | ||
.filter((el) => typeof el === "string") | ||
.map((el) => el.toLowerCase()); | ||
return array.filter((el) => typeof el === "string").map((el) => el.toLowerCase()); | ||
} | ||
@@ -202,2 +202,3 @@ return []; | ||
this.correlationId = correlationId; | ||
this.resetCorrelationId = true; | ||
} | ||
@@ -215,5 +216,5 @@ } | ||
this.persistentContext = {}; | ||
this.correlationId = ""; | ||
this.applicationName = ""; | ||
this.serviceName = ""; | ||
if (this.resetCorrelationId) { | ||
this.correlationId = randomUUID(); | ||
} | ||
} | ||
@@ -220,0 +221,0 @@ metric(activity, meta) { |
{ | ||
"name": "@serverless-guru/logger", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Common logger utility", | ||
@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
55556
0.54%803
0.5%