otel_logger 0.1.0-beta.1 copy "otel_logger: ^0.1.0-beta.1" to clipboard
otel_logger: ^0.1.0-beta.1 copied to clipboard

OpenTelemetry instrumentation for `package:logger` (the popular pretty-print logger by leisim). Provides a `LogOutput` subclass that mirrors every log event into the OTel logs pipeline, carrying `trac [...]

Changelog #

0.1.0-beta.1 - 2026-05-13 #

Added #

  • OTelLogOutput extends LogOutput — drops into any Logger(...) construction and mirrors every event into the OpenTelemetry logs pipeline. Carries trace_id / span_id from Context.current so log lines inside a Tracer.startActiveSpan block are auto-correlated with the surrounding span.
  • Maps logger.Level → OTel Severity: trace → TRACE, debug → DEBUG, info → INFO, warning → WARN, error → ERROR, fatal → FATAL. Deprecated verbose aliases TRACE and wtf aliases FATAL.
  • LogEvent.error / LogEvent.stackTrace lift to OTel exception.type / exception.message / exception.stacktrace attributes. includeStackTrace: false opts out of the trace.
  • runWithoutLoggerInstrumentation / async variant — zone-scoped suppression matching the rest of the OSS wrappers.
  • 5 tests covering severity mapping, exception attribute attachment, opt-out, and suppression.
0
likes
140
points
12
downloads

Documentation

API reference

Publisher

verified publisherdartastic.io

Weekly Downloads

OpenTelemetry instrumentation for `package:logger` (the popular pretty-print logger by leisim). Provides a `LogOutput` subclass that mirrors every log event into the OTel logs pipeline, carrying `trace_id` / `span_id` from the active span.

License

Apache-2.0 (license)

Dependencies

dartastic_opentelemetry, dartastic_opentelemetry_api, logger

More

Packages that depend on otel_logger