Skip to content

Introduce stdout/stderr log targets to replace using File to log to stdout#176

Merged
mozzieongit merged 3 commits intomainfrom
change-stdout
Oct 14, 2025
Merged

Introduce stdout/stderr log targets to replace using File to log to stdout#176
mozzieongit merged 3 commits intomainfrom
change-stdout

Conversation

@mozzieongit
Copy link
Member

@mozzieongit mozzieongit commented Oct 8, 2025

As seen in #163, writing to /dev/stdout fails with No such device or address, due to it being a UNIX socket when run under systemd. This fixes the problem by using Rust's builtin Stdout and Stderr output streams.

This also fixes the panic when unable to create the logger update by printing the error using eprintln! and moving on. Should this cleanly exit the program?

Also moves the ansi color codes to a common module for later use when implementing colors for log levels.

Fixes: #163

@mozzieongit mozzieongit requested a review from a team October 8, 2025 17:35
@mozzieongit mozzieongit self-assigned this Oct 8, 2025
@mozzieongit mozzieongit added this to the 0.1.0-alpha2 milestone Oct 8, 2025
Copy link
Member

@ximon18 ximon18 left a comment

Choose a reason for hiding this comment

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

LGTM, but I'd like to actually test to see that it solves the systemd problem.

@mozzieongit
Copy link
Member Author

I tested it in my VMs with Ubuntu, Debian, and Rocky

@mozzieongit mozzieongit merged commit 8d23131 into main Oct 14, 2025
27 checks passed
@mozzieongit mozzieongit deleted the change-stdout branch October 14, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panics when started via systemd due to unwrap on "No such device or address" error

2 participants