gregschmit / omake

An extra implementation of make.
MIT License
17 stars 1 forks source link

Show offending line if context provided to log_warn or log_err. #2

Closed gregschmit closed 1 year ago

gregschmit commented 2 years ago

Perhaps use different colors for warn vs err? Probably should do colors only if a tty is detected.

I think is-terminal is the best current Rust solution for providing isatty functionality cross-platform?

gregschmit commented 1 year ago

Right now the logging system will show the line number, but we could easily go scan that line or just add the line content to the Context struct?

xadaemon commented 1 year ago

Right now the logging system will show the line number, but we could easily go scan that line or just add the line content to the Context struct?

aving the line number should be easy to read the line from the file again, or just clone the line into the struct.

xadaemon commented 1 year ago

You can assign me to this one and the MAKE one

xadaemon commented 1 year ago

I guess this one can be closed since merging #9

gregschmit commented 1 year ago

Re-opening because I didn't realize the line isn't actually printed out anywhere just stored in the struct. I also adjusted it to store the line in the struct while parsing, which while uses a little bit more memory, is much faster than re-reading the line during logging.