lhisp-logger 2.2.5 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lhisp-logger",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "description": "",
5
5
  "main": "src/lhisp-logger",
6
6
  "types": "src/lhisp-logger.d.ts",
@@ -32,7 +32,7 @@ function getEtcHostname() {
32
32
  }
33
33
  }
34
34
  function lhLogger(options = {}) {
35
- const { name = process.env.LOG_NAME || undefined, level = process.env.LOG_LEVEL || "info", destination = process.env.LOG_DESTINATION, sync = !!process.env.LOG_SYNC, pretty = true, colorize = true, ignore = "pid,hostname", translateTime = "yyyy-mm-dd HH:MM:ss", singleLine = true, lokiEnabled = (process.env.LOG_LOKI_ENABLED || "true").toLowerCase() !== "false", lokiUrl = process.env.LOG_LOKI_URL ||
35
+ const { name = process.env.LOG_NAME || undefined, level = process.env.LOG_LEVEL || "info", destination = process.env.LOG_DESTINATION, sync = !!process.env.LOG_SYNC, pretty = true, colorize = true, ignore = "pid,hostname", translateTime = "yyyy-mm-dd HH:MM:ss", singleLine = true, lokiEnabled = (process.env.LOG_LOKI_ENABLED || "false").toLowerCase() !== "false", lokiUrl = process.env.LOG_LOKI_URL ||
36
36
  `${process.env.LOG_LOKI_PROTOCOL || "http"}://${process.env.LOG_LOKI_HOST || "logs.lhprovedor.com.br"}:${process.env.LOG_LOKI_PORT || "3100"}`, } = options;
37
37
  const baseConfig = {
38
38
  name,
@@ -102,7 +102,8 @@ exports.default = lhLogger;
102
102
  // Recursively serialize any axios error present in the provided value.
103
103
  // Handles arrays, plain objects, and protects against circular structures.
104
104
  function deepSerializeAxiosErrors(value, seen) {
105
- if (typeof value !== "object")
105
+ // Guard against null which has typeof 'object' but is invalid for WeakSet
106
+ if (value === null || typeof value !== "object")
106
107
  return value;
107
108
  // axios errors have a distinctive shape; use isAxiosError to detect
108
109
  if ((0, isAxiosError_1.isAxiosError)(value)) {