Open maralorn opened 1 year ago
Hi! I'm currently trying to integrate nom
into my nixos rebuild script and was looking for something like this. Ideally I'd want to pipe any build output to a log file and only show the nice nom
output. Redirection is already easily possible by using tee
(as discussed in #89) but I wasn't able to stop nom
from printing the logs yet. (I've tried using grep
with the unicode box drawing chars, but it doesn't seem to handle escape codes nicely ^^).
I understand that implementing this with an option and a variable number of log lines etc. is probably not super trivial and I sadly don't think I'm able to implement this myself, because I'm not really used to functional programming much.
If this was a procedural program, I'd expect to be able to comment out a couple of lines (that are responsible for piping through the logs) somewhere. (This way I could create a patch for this and add it as a package overlay). Like I said, I'm not super familiar with Haskell, but I'd kinda expect this to work similarily.
So could you maybe direct me to the section in the code were the output redirection happens? Thanks a lot!
(Related issues: #89, #99, #126 would also be a nice to have for this).
For a quick an dirty solution you can set this variable to the empty list.
Perfect, this is exactly what I was looking for, thanks a ton! ❤️
If anyone's interested, here's an override which implements this.
We can add an option called --log-lines with the semantic
infinity: print everything, continuous log, default 0: don‘t print logs n: always show n last lines of log, clearing everything above and hiding log, when build has finished, could be default for shell and other ambient commands.