commit | ba8f7f69681294f8f74f5c2d919d67d3266661fa | [log] [tgz] |
---|---|---|
author | Marcin Radomski <dextero@google.com> | Tue Sep 17 15:54:50 2024 +0000 |
committer | Marcin Radomski <dextero@google.com> | Tue Sep 17 17:31:03 2024 +0000 |
tree | f974c2c8107cdd684b2b87b1278b8e89a52dd399 | |
parent | e7131122ebd3be8c6326af7309d9a1ca0b664f6b [diff] |
log crate: add modules with statically defined log levels Use log crate features [1] to compile out all log statements below certain log level. Add `info` to disable trace/debug logs for a functionality similar to defining LOG_NDEBUG in liblog [2], and `off` to compile out all logs. Crash messages still remain. Each binary/shared library has to explicitly opt in to using one of those by selecting a specific version as its dependency. It makes some or all log messages to be omitted from the resulting binary. The change was made by adjusting cargo_embargo.json and running cargo_embargo generate cargo_embargo.json [1] https://docs.rs/log/latest/log/#compile-time-filters [2] https://cs.android.com/android/platform/superproject/main/+/main:system/logging/liblog/include/log/log.h;l=51 Bug: 270616750 Test: http://ag/29465173 - run the binary and the output of `strings` on Test: it, see no VERBOSE/DEBUG logs Change-Id: I69836e3a51ab2ccb8ee7ee144ee3231184c29d48