makisu
makisu copied to clipboard
--log-fmt=console could be more human readable
Makisu offers two logging formats, --log-fmt=json and --log-fmt=console. Many users would be used to a "docker build" command line experience, but neither log-fmt offers the same type of human-readable output. The "console" format is more human-readable than json, but it could be improved.
Observations
- Unusually, the timestamp for --log-fmt=console is reported in nanos-since-epoch in an exponential format, e.g.
1.571969064344166e+09
- Printing the log level (info / error) is only useful when grepping for errors, but often error is not an error, but when the RUN command prints to stderr
- When RUN commands output a trailing newline, console logger prints it and still adds its own
Suggestions
- An improvement would be to make the timestamp an RFC-3339 or ISO-8601 format, or print ISO-8601 at the start and later log lines print {seconds.micros} since makisu start
- Docker omits printing "info" when printing standard messages, and stderr is printed in red. This gives a human readable output.
- Trim trailing newlines when echoing to the terminal as console logger prints its own newline