Skip to content

[Feature]: ANSI codes cause difficult to read logs #4

Description

@OneCricketeer

Problem to solve

On using kubectl logs (in Ghostty), I get colored logs

Image

While in Krust and k9r I see this (and the operator_license::checked_license line appears to be cut off; it appears the font in the image has been italicized)

18:42:53.269  Starting mirrord operator!
18:42:53.275  �[2m2026-07-30T18:42:53.275784Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1518:�[0m Tracing setup completed
18:42:53.276  �[2m2026-07-30T18:42:53.275828Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1543:�[0m mirrord operator version: 3.182.0
18:42:53.277  �[2m2026-07-30T18:42:53.276883Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1575:�[0m operator instance id  �[0mef5d4e1c-d569-40ec-a123-d89ab4104a5a
18:42:53.309  �[2m2026-07-30T18:42:53.309590Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1597:�[0m Operator cloud API key configured; authenticating to the cloud with short-lived tokens.
18:42:53.309  �[2m2026-07-30T18:42:53.309621Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1612:�[0m Starting shared services (license) before leadership election
18:42:54.033  �[2m2026-07-30T18:42:54.032799Z�[0m �[32m INFO�[0m main �[2moperator_license::checked_license�[0m�[2m:�[0m �[2m223:�[0m Loaded license!  �[0mLicenseInfo
18:42:54.085  �[2m2026-07-30T18:42:54.084922Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1650:�[0m Starting health probe and OpenAPI router on the main port  �[0m[::]:443  �[0mSome(0.0.0.0:443)
18:42:54.085  �[2m2026-07-30T18:42:54.084992Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1271:�[0m Bound listener  �[0m[::]:443
18:42:56.404  �[2m2026-07-30T18:42:56.404223Z�[0m �[32m INFO�[0m main �[2moperator_service�[0m�[2m:�[0m �[2m1702:�[0m Leadership acquired, building full router
18:42:56.656  �[2m2026-07-30T18:42:56.655925Z�[0m �[32m INFO�[0m tokio-rt-worker �[2moperator_service::tls�[0m�[2m:�[0m �[2m285:�[0m client_ca_watcher: reloaded rustls config with new front-proxy client CA
18:42:56.688  �[2m2026-07-30T18:42:56.686962Z�[0m �[33m WARN�[0m            main �[2moperator_service�[0m�[2m:�[0m �[2m867:�[0m Database branching controller flags  �[0mtrue  �[0mfalse  �[0mfalse  �[0mfalse  �[0mfalse  �[0mtrue  �[0mfalse  �[0mfalse  �[0mtrue
18:42:56.688  �[2m2026-07-30T18:42:56.686997Z�[0m �[33m WARN�[0m            main �[2moperator_service�[0m�[2m:�[0m �[2m889:�[0m Starting legacy adapter and unified branch controller
18:42:56.689  �[2m2026-07-30T18:42:56.689308Z�[0m �[32m INFO�[0m            main �[2moperator_service�[0m�[2m:�[0m �[2m1271:�[0m Bound listener  �[0m[::]:9000
18:42:56.689  �[2m2026-07-30T18:42:56.689391Z�[0m �[32m INFO�[0m            main �[2moperator_service�[0m�[2m:�[0m �[2m1706:�[0m Shutting down probe and OpenAPI server to start full API
18:42:56.690  �[2m2026-07-30T18:42:56.690627Z�[0m �[32m INFO�[0m            main �[2moperator_service�[0m�[2m:�[0m �[2m1714:�[0m Starting full API server
18:42:56.690  �[2m2026-07-30T18:42:56.690666Z�[0m �[32m INFO�[0m            main �[2moperator_service�[0m�[2m:�[0m �[2m1271:�[0m Bound listener  �[0m[::]:443

Proposed solution

Use a different font family or log viewer that can parse ANSI codes.

In VSCode, I've had to use ANSI Colors extension, to view similar output.

Alternatives considered

No response

Impact

Easier service diagnostics due to not having to parse-out text runes

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions