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

Add option to suppress color in mqtt log_topic messages #3051

Open
barcar opened this issue Feb 16, 2025 · 0 comments
Open

Add option to suppress color in mqtt log_topic messages #3051

barcar opened this issue Feb 16, 2025 · 0 comments

Comments

@barcar
Copy link

barcar commented Feb 16, 2025

Describe the problem you have/What new integration you would like

I would like to have an option to suppress the ANSI color codes from the MQTT messages emitted when log_topic is configured.

Something like the last 3 lines of this YAML snippet:

mqtt:
  broker: !secret mqtt_broker
  username: !secret mqtt_username
  password: !secret mqtt_password
  id: ${mqtt_client}
  topic_prefix: "esphome/${name}"
  discovery_prefix: ${topic_prefix}_discovery
  discovery: false
  log_topic: 
    topic: ${topic_prefix}/${name}/log
    include_color: false

Please describe your use case for this integration and alternatives you've tried:

MQTT log messages contain the ANSI color codes which makes them difficult to read. For example:

�[0;33m[W][component:238]: Components should block for at most 30 ms.�[0m

I would prefer them to be simply:

[W][component:238]: Components should block for at most 30 ms.

There do not seem to be any ways to pre-process these messages before they are sent.

Additional context

Nothing to add.

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

No branches or pull requests

1 participant