You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the log viewer does not support proper handling of ANSI escape codes, which are often used to add color, style, or special formatting to terminal output. When such codes are present in logs, they either appear as raw text or disrupt readability. This feature request is to enhance the log viewer by correctly interpreting and rendering ANSI escape codes.
For example, the Ray machine learning framework outputs logs with ANSI colour codes by default. These codes enhance log clarity during debugging but can clutter output when not handled properly. While this behaviour can be disabled by setting the environment variable RAY_COLOR_PREFIX=0, the default behaviour assumes support for ANSI codes and users wish not to turn it off. Proper handling in the log viewer would ensure seamless integration with Ray logs.
Possible implementation
Detection of ANSI Codes: Add a parser to detect ANSI escape sequences in the log text (e.g., \033[31m for red text, \033[0m to reset formatting).
Map ANSI Codes to Styles: Create a mapping of ANSI escape codes to styles supported by Monaco Editor. This might involve defining custom CSS classes or inline styles for text color, background colour, and formatting (bold, underline, etc.).
(Alternative to 2.) Fallback for Unsupported Formats: If it's none-trivial to add ANSI mappings, strip ANSI codes and provide plain-text logs as a fallback.
The text was updated successfully, but these errors were encountered:
Request
Currently, the log viewer does not support proper handling of ANSI escape codes, which are often used to add color, style, or special formatting to terminal output. When such codes are present in logs, they either appear as raw text or disrupt readability. This feature request is to enhance the log viewer by correctly interpreting and rendering ANSI escape codes.
For example, the Ray machine learning framework outputs logs with ANSI colour codes by default. These codes enhance log clarity during debugging but can clutter output when not handled properly. While this behaviour can be disabled by setting the environment variable
RAY_COLOR_PREFIX=0
, the default behaviour assumes support for ANSI codes and users wish not to turn it off. Proper handling in the log viewer would ensure seamless integration with Ray logs.Possible implementation
\033[31m
for red text,\033[0m
to reset formatting).The text was updated successfully, but these errors were encountered: