Implement the logging package for mixer.
A common log file can be set for all the mixer commands in the
builder.conf. E.g. `mixer config set Mixer.LOG <filepath>`
The log file and level can also be set for individual mixer
commands using the `--log` and `--log-level` flags respectively.
The various log levels are:
ERROR (1), WARNING (2), INFO (3), DEBUG (4) and VERBOSE (5).
Default log level is 4.
Fixes#666
Signed-off-by: Ashlesha Atrey ashlesha.atrey@intel.com
Logger default date/time are prefixes and don't play well when
printing multiple lines. What usually matters is the amount of time
elapsed since the start, so print that instead (when each new entry
that is not the first is starting).
Use the logger interface to write stopwatch output. With this change,
any error that occurs while trying to write the output is handled
internally by the log module.
This patch also fix a bug where the line break was printed to STDOUT
instead of the stopwatch buffer.
Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
Add a small struct to count the time taken by the important steps of
BuildUpdate. This will make easier to compare when we move the steps
to use the new swupd implementation -- and might be useful to keep
even after that comparison is not needed.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>