Skip to content

feat(sdk): emit log severity as uppercase (INFO/WARN/ERROR/DEBUG)#302

Open
igoramf wants to merge 1 commit into
mainfrom
log-level-uppercase
Open

feat(sdk): emit log severity as uppercase (INFO/WARN/ERROR/DEBUG)#302
igoramf wants to merge 1 commit into
mainfrom
log-level-uppercase

Conversation

@igoramf

@igoramf igoramf commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Default console-JSON adapter: level field now uppercase (INFO, WARN, ERROR, DEBUG).
  • OTLP direct-POST log adapter: severityText now uppercase (was lowercase; severityNumber unchanged — still 5/9/13/17 per OTLP spec).
  • otel.ts warnDirect boot/exporter breadcrumbs (observability booted, otlp {metrics,traces,error-log} exporter) now also emit uppercase level.

Scope

Traces (status.code) and metrics have no textual severity field — enum-numeric only — so nothing to change there.

Test plan

  • logger.test.ts, otel.test.ts, otelHttpLog.test.ts updated to assert uppercase.
  • Confirm downstream log viewer (HyperDX / CF Logs) renders INFO/WARN/ERROR/DEBUG.

🤖 Generated with Claude Code


Summary by cubic

Standardizes log severity strings to uppercase (INFO/WARN/ERROR/DEBUG) across the SDK so log viewers display consistent levels.

  • Bug Fixes
    • Console JSON adapter: level is now uppercase.
    • OTLP HTTP adapter: severityText is now uppercase; severityNumber unchanged (5/9/13/17).
    • otel.ts boot/exporter breadcrumbs now emit uppercase levels.

Written for commit 7ce2771. Summary will update on new commits.

Review in cubic

Both the default console-JSON adapter (`level`) and the OTLP direct-POST
adapter (`severityText`) were emitting lowercase level strings. Uppercase
them so downstream log viewers show INFO/WARN/ERROR/DEBUG consistently.
Also uppercases the 4 `warnDirect` boot/exporter breadcrumbs in otel.ts.

`severityNumber` (OTLP) unchanged — still 5/9/13/17 per spec.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@igoramf igoramf requested a review from a team July 2, 2026 16:24

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants