mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Fix SAPI_VLOG_LEVEL handling so that VLOGs at level <= the specified level are printed.
PiperOrigin-RevId: 453652875 Change-Id: Ibd0f2c54a0e5c6bab7e65633b5b5680dbe36f5ae
This commit is contained in:
parent
eef4707cd1
commit
a8a558c66d
|
@ -149,7 +149,7 @@ void SafeWriteToStderr(const char* s, size_t len) {
|
|||
|
||||
bool VLogIsOn(int verbose_level) {
|
||||
static int external_verbose_level = [] {
|
||||
int external_verbose_level = std::numeric_limits<int>::max();
|
||||
int external_verbose_level = std::numeric_limits<int>::min();
|
||||
char* env_var = getenv("SAPI_VLOG_LEVEL");
|
||||
if (!env_var) {
|
||||
return external_verbose_level;
|
||||
|
@ -159,7 +159,7 @@ bool VLogIsOn(int verbose_level) {
|
|||
"SAPI_VLOG_LEVEL needs to be an integer >= 0");
|
||||
return external_verbose_level;
|
||||
}();
|
||||
return verbose_level >= external_verbose_level;
|
||||
return verbose_level <= external_verbose_level;
|
||||
}
|
||||
|
||||
} // namespace sapi::raw_logging_internal
|
||||
|
|
Loading…
Reference in New Issue
Block a user