Skip to content

feat: add log message color configuration#108

Open
Wafffle77 wants to merge 3 commits into
mainfrom
term-color
Open

feat: add log message color configuration#108
Wafffle77 wants to merge 3 commits into
mainfrom
term-color

Conversation

@Wafffle77

@Wafffle77 Wafffle77 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Template

Thank you for your contribution! Please ensure the following before submitting:

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Description

Adds a --log-color option for controlling colored log output. In addition to "on" and "off", "auto" (the default) will detect whether or not stderr is a terminal and act accordingly.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

Signed-off-by: Ethan Clark <ethan.clark@trojans.dsu.edu>
Signed-off-by: Ethan Clark <ethan.clark@trojans.dsu.edu>
Signed-off-by: Ethan Clark <ethan.clark@trojans.dsu.edu>

@synackd synackd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I tested this and it works well.

However, there is a missing piece that is required for config merging to work correctly. For instance, if I:

# Set value in user config
ochami config set log.color on

I can see it get changed in the user config:

$ ochami config show log.color --user
on

But the merged config uses the default value:

$ ./ochami config show log.color
auto

To fix this, we'll have to add a case for this config value in the custom config unmarshaller. There is already code there for timeout (case statement, default value setting) that can serve as a reference.

@synackd synackd changed the title Term color feat: add log message color configuration Jul 1, 2026
@synackd

synackd commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

I adjusted the title of this PR to follow Conventional Commit format for the future squash merge.

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