Skip to content

NO_COLOR support #236

Description

@nikableh

Bump eyre-rs/color-eyre#99.

I love color-eyre when developing locally; it is so incredibly helpful! But the colors are a problem when deploying to prod where, for example, Cloudwatch logs for AWS Lambda functions just include raw ANSI escape sequences. I'm working around that right now by using this code in my setup function:

    if std::env::var("NO_COLOR") == Err(std::env::VarError::NotPresent) {
        color_eyre::install()?;
    } else {
        color_eyre::config::HookBuilder::new()
            .theme(color_eyre::config::Theme::new())
            .install()?;
    }

and making sure our prod deployments include NO_COLOR=1.

I'd love to see either:

a mention of this particular pattern in the docs (I searched and couldn't find anything), or
a change to HookBuilder::blank() selecting either the default dark theme or the blank theme based on the presence of NO_COLOR
I'm sure you've already seen this, but I found https://no-color.org/ helpful

I'm sorry I don't have the time right now to write up a draft PR for you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions