Skip to content

fix(cli): correct FATAL log detection and add test coverage for prefix format - #1636

Open
PrinceGautam2106 wants to merge 1 commit into
mofa-org:mainfrom
PrinceGautam2106:cursor/fix-fatal-log-color
Open

PrinceGautam2106 wants to merge 1 commit into
mofa-org:mainfrom
PrinceGautam2106:cursor/fix-fatal-log-color

Conversation

@PrinceGautam2106

Copy link
Copy Markdown

Problem

The CLI log colorization logic incorrectly checks for " FATAL" (with a leading space):

upper.contains(" FATAL")

This causes logs like:

FATAL: process crashed

to not be detected as fatal errors, since they do not contain a leading space. As a result, such logs are not colorized correctly.

Solution

Updated the condition to correctly detect "FATAL" without requiring a leading space.
This ensures all fatal log messages are consistently identified regardless of formatting.
upper.contains("FATAL")

Improvements

  • Fixes incorrect log level detection for fatal messages
  • Ensures proper red colorization for all fatal logs
  • Handles common formats like FATAL: and FATAL error

Handle FATAL-prefixed log lines without requiring surrounding spaces and add a regression test.

Made-with: Cursor
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