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

Check tty before colorizing output #11645

Merged
merged 1 commit into from
Mar 2, 2022

Conversation

deviantintegral
Copy link
Sponsor Contributor

I'm forwarding all logs from the host zigbee2mqtt is installed on over syslog to a graylog instance. As is, that means that terminal colours are being shown:

zigbee2mqtt npm[8991]: #033[32mZigbee2MQTT:info #033[39m 2022-02-27 17:07:06: Stopping zigbee-herdsman...

This checks if output is a TTY, and applies colorization as needed.

Strangely, the new code is still showing 100% test coverage. There must be something calling this branch without asserting. Perhaps there's coverage markers that need to be added?

@Koenkk
Copy link
Owner

Koenkk commented Feb 28, 2022

Strangely, the new code is still showing 100% test coverage. There must be something calling this branch without asserting. Perhaps there's coverage markers that need to be added?

That it is been covered doesn't necessarily mean that it is tested (asserted).

Anyway, this looks fine to me; will merge it after the next release (2 march)

@Koenkk
Copy link
Owner

Koenkk commented Mar 2, 2022

thanks!

@Koenkk Koenkk enabled auto-merge (squash) March 2, 2022 19:07
@Koenkk Koenkk disabled auto-merge March 2, 2022 19:07
@Koenkk Koenkk merged commit 364a6dd into Koenkk:dev Mar 2, 2022
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