Open peter81git opened 2 weeks ago
@peter81git Hi! Hey, just FYI I'm at KubeCon NA 2024 all week and pretty busy... will try my best to get to this some time in the evening this week. Thanks for your patience!
Hi! It is true that timestamps help, but ghw
warnings are meant for exceptional circumstances rather than standard logging. I'd rather let callers pass a go-logr
handle to use in ghw
packages. This is a much larger effort though.
logr reference: https://github.com/go-logr/logr
While we debate if adding support for go-logr
or not, you can use option.WithAlerter
(see: https://github.com/jaypipes/ghw/blob/main/pkg/option/option.go#L179) to replace the default logger with one which adds timestamps without needing changes to ghw
code
For better log management it is required to have a timestamp for every line in the log file. Is it possible to add it like
[2024-11-11T18:52:27.937395+00:00] WARNING: failed to determine nodes: open /sys/devices/system/node: no such file or directory
? Thank you.