From db1d5b1b00325df4f137ad9407f283ce94b1633b Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Fri, 24 Apr 2026 17:38:03 -0300 Subject: [PATCH 1/2] fix: use console.error to avoid recursion --- src/exceptions/ContextNotInitializedException.ts | 2 +- src/otel/OtelImpl.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/exceptions/ContextNotInitializedException.ts b/src/exceptions/ContextNotInitializedException.ts index c84002e..402563e 100644 --- a/src/exceptions/ContextNotInitializedException.ts +++ b/src/exceptions/ContextNotInitializedException.ts @@ -7,7 +7,7 @@ export class ContextNotInitializedException extends Exception { super({ code: 'E_CONTEXT_NOT_INITIALIZED', message, - help: 'Use ({yellow, bold} Otel.withContext(() => { ... })) to initialize the context store.' + help: 'Use Otel.withContext(() => { ... }) to initialize the context store.' }) } } diff --git a/src/otel/OtelImpl.ts b/src/otel/OtelImpl.ts index af36306..b51478b 100644 --- a/src/otel/OtelImpl.ts +++ b/src/otel/OtelImpl.ts @@ -16,7 +16,6 @@ import { type Context } from '@opentelemetry/api' -import { Log } from '@athenna/logger' import { Config } from '@athenna/config' import { NodeSDK } from '@opentelemetry/sdk-node' import { Is, Options, Macroable } from '@athenna/common' @@ -440,7 +439,7 @@ export class OtelImpl extends Macroable { ) if (!store || !(store instanceof Map)) { - Log.channelOrVanilla('exception').error(new ContextNotInitializedException()) + console.error(JSON.stringify(new ContextNotInitializedException(), null, 2)) return new Map() } From 8d69c426f6e57d1e0ab75a241a2f849bff596638 Mon Sep 17 00:00:00 2001 From: jlenon7 Date: Fri, 24 Apr 2026 17:38:33 -0300 Subject: [PATCH 2/2] chore: update dependencies --- package-lock.json | 4 ++-- package.json | 2 +- src/otel/OtelImpl.ts | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4813bde..6c50c94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@athenna/otel", - "version": "5.15.0", + "version": "5.16.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@athenna/otel", - "version": "5.15.0", + "version": "5.16.0", "license": "MIT", "dependencies": { "@opentelemetry/api": "^1.9.0", diff --git a/package.json b/package.json index 1e14626..5d50740 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/otel", - "version": "5.15.0", + "version": "5.16.0", "description": "OpenTelemetry package for Athenna.", "license": "MIT", "author": "João Lenon ", diff --git a/src/otel/OtelImpl.ts b/src/otel/OtelImpl.ts index b51478b..8a42454 100644 --- a/src/otel/OtelImpl.ts +++ b/src/otel/OtelImpl.ts @@ -439,7 +439,9 @@ export class OtelImpl extends Macroable { ) if (!store || !(store instanceof Map)) { - console.error(JSON.stringify(new ContextNotInitializedException(), null, 2)) + console.error( + JSON.stringify(new ContextNotInitializedException(), null, 2) + ) return new Map() }