uber-archive / makisu

Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Apache License 2.0
2.41k stars 156 forks source link

--log-fmt=console could be more human readable #286

Open rgeary1 opened 4 years ago

rgeary1 commented 4 years ago

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

  1. Unusually, the timestamp for --log-fmt=console is reported in nanos-since-epoch in an exponential format, e.g. 1.571969064344166e+09
  2. 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
  3. When RUN commands output a trailing newline, console logger prints it and still adds its own

Suggestions

  1. 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
  2. Docker omits printing "info" when printing standard messages, and stderr is printed in red. This gives a human readable output.
  3. Trim trailing newlines when echoing to the terminal as console logger prints its own newline