Skip to content

logs: Implement colorful service names for logs command#1369

Merged
p12tic merged 3 commits intocontainers:mainfrom
mokibit:add-colors-to-logs
Jan 19, 2026
Merged

logs: Implement colorful service names for logs command#1369
p12tic merged 3 commits intocontainers:mainfrom
mokibit:add-colors-to-logs

Conversation

@mokibit
Copy link
Copy Markdown
Collaborator

@mokibit mokibit commented Jan 5, 2026

The logs command now displays short service names in color by default (the project-name prefix has been removed). An option has been added to either render service names in monochrome or omit them entirely.

This update improves compatibility of the logs command with docker-compose. For relevant documentation, see: https://docs.docker.com/reference/cli/docker/compose/logs/

Fixes: #1355, #111.

@mokibit mokibit force-pushed the add-colors-to-logs branch 2 times, most recently from 17293b8 to 4455c1c Compare January 5, 2026 14:22
Comment thread podman_compose.py Outdated
Comment thread podman_compose.py Outdated
Comment thread podman_compose.py Outdated
Copy link
Copy Markdown
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, I proposed several improvements.

Comment thread podman_compose.py Outdated
Comment thread podman_compose.py Outdated
Comment thread podman_compose.py Outdated
@mokibit mokibit force-pushed the add-colors-to-logs branch from 83b4abc to aa7c896 Compare January 10, 2026 20:29
@mokibit mokibit requested a review from p12tic January 11, 2026 07:32
@mokibit mokibit force-pushed the add-colors-to-logs branch from aa7c896 to 07cb88b Compare January 12, 2026 14:54
docker-compose shows colored logs by default. Podman prints monochrome
logs unless you explicitly ask for color.
podman-compose adds the `--color` option to every podman "logs" command,
unless the user has asked for no color with the flag `--no-color`.
This keeps the behaviour consistent with docker-compose.

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Instead of using containerID, log line now begins with a
formatted service name.
When `--no-log-prefix` flag is used, only server logs are printed,
omitting the server name prefix.

Relevant docker-compose documentation:
https://docs.docker.com/reference/cli/docker/compose/logs/

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
@mokibit mokibit force-pushed the add-colors-to-logs branch from 07cb88b to aeda5d1 Compare January 12, 2026 15:13
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
@mokibit mokibit force-pushed the add-colors-to-logs branch from aeda5d1 to 42ed080 Compare January 12, 2026 15:24
@p12tic p12tic merged commit 6aa8a36 into containers:main Jan 19, 2026
8 checks passed
@mokibit mokibit deleted the add-colors-to-logs branch January 19, 2026 16:10
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.

podman-compose logs command doesn't print colored service names as log lines prefixes

2 participants