hermit-os / loader

The Hermit bootloader.
Apache License 2.0
68 stars 22 forks source link

new: Add colored log levels #336

Closed camnwalter closed 4 months ago

camnwalter commented 5 months ago

See https://github.com/hermit-os/kernel/pull/1171

camnwalter commented 5 months ago

I don't think I can do the exact same way as I did in the kernel since option_env only checks during compile time. If I run this after compiling the loader, the loader will still output color in its logs since it was already built.

$ NO_COLOR=1 cargo xtask ci qemu --arch x86_64 --package hello_world

I'm not sure about the best way to approach this, as core doesn't have an equivalent macro to std::env::var.

mkroening commented 5 months ago

That's the same case as for the kernel, which won't change its coloring behavior once compiled. xtask ci just works because it is meant for development. The loader also has an xtask ci, so it should work for development too. For now, it is fine if it cannot be changed at runtime, so it is fine to do it the same way as in the kernel. :)