mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 20:04:20 +00:00
With the migration to env_logger, we lost the ability to initialize logging multiple times. This meant that we had to wait until we had parsed CLI args and knew exactly what we wanted our logging spec to be, which meant that it would sometimes be too late to log startup errors. This CL modifies the logging facade to be modifiable on the fly, albeit with some restrictions, to obviate the problem. The syslog API has been modified as follows: syslog::early_init: initializes stderr logging, can be called only once per process. Called as the first function in main. syslog::init/init_with: can be called after early_init to modify the parameters used by the logging system. Can be called only once per process. Will be called roughly after argument parsing or bootstrapping is complete. The fundamental change to enable this was in the logging facade. Now, the facade passes all logging operations to a static, mutex protected struct. This way, the facade never changes, but we can modify the struct whenever we wish. BUG=b:242103548 TEST=tested downstream Change-Id: I76bc1bb275c81a69aadc7f03a80b94c297f47781 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3834294 Commit-Queue: Noah Gold <nkgold@google.com> Tested-by: Noah Gold <nkgold@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> |
||
---|---|---|
.. | ||
base_event_token_derive | ||
src | ||
.build_test_serial | ||
Cargo.toml |