Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Color Logging for Error Messages #406

Merged
merged 2 commits into from
Feb 4, 2024
Merged

Conversation

cubxxw
Copy link
Contributor

@cubxxw cubxxw commented Feb 4, 2024

This PR introduces color logging for error messages in the openim::log::error function. By incorporating red color to the error logs, it aims to enhance readability and make it easier for developers to identify and debug errors in a sea of console output. The modification utilizes ANSI color codes to apply red color to both the initial error message and any subsequent messages passed to the function. This feature is implemented in a backward-compatible manner, ensuring that existing functionality remains unaffected while providing an optional visual cue for error logging.

Key Changes:

  • Defined ANSI color codes for red and no color (reset) within the openim::log::error function.
    Applied these color codes to the error messages output to ensure they are displayed in red on compatible terminals.
  • Ensured that the color is reset to the default after the error message is logged to avoid affecting the terminal's subsequent output color.
  • This change is a step towards improving the developer experience by making log messages more informative and easier to navigate.

@cubxxw cubxxw requested review from a team as code owners February 4, 2024 04:30
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 4, 2024
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 4, 2024
@kubbot kubbot enabled auto-merge February 4, 2024 12:08
@kubbot kubbot added this pull request to the merge queue Feb 4, 2024
Merged via the queue into main with commit a030b8a Feb 4, 2024
11 checks passed
@kubbot kubbot deleted the feat/add-main-code branch February 4, 2024 12:09
@openimsdk openimsdk locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants