@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 CHANGED
@@ -55,7 +55,7 @@ import { getLogger } from '@sebspark/otel'
55
55
 
56
56
  const logger = getLogger()
57
57
 
58
- // Will throw if OTEL is not yet initialized
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
- throw new Error("OTEL must be initialized before calling getLogger()");
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
- throw new Error("OTEL must be initialized before calling getLogger()");
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());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebspark/otel",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",