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
This patch changes how Warnings and Error messages are printed
throughout the code to use the `log` package instead of `fmt`. This
allows for finer control over what is printed and where it is printed
to.
Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
The client.State struct is used to download and query manifests and
files from a specific swupd repository (and version). It does support
caching of data.
Besides the expected changes to make it is own package
- Only print "downloading" messages when Verbose is set in the struct
- Allow not passing an expected hash when verifying bundles
- Add a GetMoM function to the client.State
This is still an internal package since I think it needs more
iterations before becoming a public package. That said, the upcoming
swupd-inspector tool was implemented with almost no significant change
to the original code.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>