Skip to content

Bug(logging): NO_COLOR env variable is not respected when console logging is enabled #859

@erezrokah

Description

@erezrokah

Describe the Bug

We only partially respect the NO_COLOR env variable, see:
cloudquery fetch:
image

NO_COLOR=1 cloudquery fetch
image

NO_COLOR=1 cloudquery fetch --enable-console-log
image

The latter is especially problematic as we enable console logging when redirecting to files so if someone runs:
cloudquery fetch 2> err.txt 1> out.txt

Their err.txt looks like this:
image

Expected Behavior

Respect NO_COLOR env variable in all cases.
Ideally detect when running in non interactive environment or ones that don't support colors and disable colors automatically.

CloudQuery Version

Version: 0.24.9
Commit: b5af06b570558612c95407dceb4200f92640f335
Date: 2022-06-06T13:32:45Z

Debug Output

See above

Steps to Reproduce

See above

References

See also #858

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