Skip to content

ostrace: fix --nojson flag and add ANSI color-coded output for plain text mode#718

Open
zt-luo wants to merge 1 commit into
danielpaulus:mainfrom
zt-luo:ostrace-nojson-colors
Open

ostrace: fix --nojson flag and add ANSI color-coded output for plain text mode#718
zt-luo wants to merge 1 commit into
danielpaulus:mainfrom
zt-luo:ostrace-nojson-colors

Conversation

@zt-luo
Copy link
Copy Markdown

@zt-luo zt-luo commented May 10, 2026

  • Fix --nojson flag: use structured plain-text output via formatEntryPlain instead of raw JSON dump
  • Add human-readable plain-text output with ANSI color coding:
    • Info → cyan, Debug → gray, Error → red, Fault → bold red
    • Subsystem/category label dimmed in gray
    • Timestamp in RFC3339 format
  • Add isTerminal() check: color codes are only emitted when stdout is a TTY (clean output in pipes/files)
  • Format: [timestamp] PID:##### <Level> [subsystem:category] message

@zt-luo zt-luo force-pushed the ostrace-nojson-colors branch from a0ab8c9 to ad21325 Compare May 10, 2026 04:15
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.

1 participant