sandia-minimega / minimega

minimega
GNU General Public License v3.0
148 stars 66 forks source link

minimega: not all errors are propagated to log files #1377

Open djfritz opened 4 years ago

djfritz commented 4 years ago

Describe your environment

  1. minimega version 2.6

Describe the bug Some errors are not being propagated anywhere but stderr, even if stderr logging is disabled:

log stderr false
log file foo

# will log to foo
broken command

# will not log to foo (see #1376 as to why this is an error)
vm config net a
unable to determine valid QEMU hosts -- exec: "kvm": executable not found in $PATH

Expected behavior The second error should log to the file, not to stderr.

djfritz commented 4 years ago

I'm guessing minicli/output.go needs to have Responses' String() and Error() functions reworked a bit. We want to push errors to the logging subsystem and non-error responses along the normal path, but it's not currently possible to separate those for later consumption by the cli back in minimega (String() joins them currently it looks like).

@jcrussell thoughts on changes here?