@sebspark/otel 1.0.2 → 1.0.3
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/README.md +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ import { getLogger } from '@sebspark/otel'
|
|
|
55
55
|
|
|
56
56
|
const logger = getLogger()
|
|
57
57
|
|
|
58
|
-
// Will
|
|
58
|
+
// Will do nothing if OTEL is not yet initialized
|
|
59
59
|
logger.debug('debug message')
|
|
60
60
|
logger.info('something happened')
|
|
61
61
|
logger.warn('almost bad')
|
package/dist/index.js
CHANGED
|
@@ -799,7 +799,8 @@ function getLogger(serviceOverride, extraAttrs = {}) {
|
|
|
799
799
|
};
|
|
800
800
|
function emit(severityText, body, attrs = {}) {
|
|
801
801
|
if (!isInitialized()) {
|
|
802
|
-
|
|
802
|
+
console.warn("OTEL must be initialized before using logger");
|
|
803
|
+
return;
|
|
803
804
|
}
|
|
804
805
|
const logger = import_api_logs3.logs.getLogger(systemName, systemVersion);
|
|
805
806
|
const span = import_api4.trace.getSpan(import_api4.context.active());
|
package/dist/index.mjs
CHANGED
|
@@ -784,7 +784,8 @@ function getLogger(serviceOverride, extraAttrs = {}) {
|
|
|
784
784
|
};
|
|
785
785
|
function emit(severityText, body, attrs = {}) {
|
|
786
786
|
if (!isInitialized()) {
|
|
787
|
-
|
|
787
|
+
console.warn("OTEL must be initialized before using logger");
|
|
788
|
+
return;
|
|
788
789
|
}
|
|
789
790
|
const logger = logs2.getLogger(systemName, systemVersion);
|
|
790
791
|
const span = trace2.getSpan(context2.active());
|