Introduce a SAPI_RAW_VLOG_IS_ON just for raw_logging

PiperOrigin-RevId: 558094899
Change-Id: I9da55eb55af22eafc74a81999dc920dbab98a1a3
This commit is contained in:
Wiktor Garbacz 2023-08-18 03:11:57 -07:00 committed by Copybara-Service
parent ff23e878d3
commit bf9fe79dbe
3 changed files with 6 additions and 4 deletions

View File

@ -472,13 +472,13 @@ absl::Status Mounts::AddMappingsForBinary(const std::string& path,
to_resolve.emplace_back(imported_lib, 1); to_resolve.emplace_back(imported_lib, 1);
} }
if (SAPI_VLOG_IS_ON(1)) { if (SAPI_RAW_VLOG_IS_ON(1)) {
SAPI_RAW_VLOG( SAPI_RAW_VLOG(
1, "Resolving dynamic library dependencies of %s using these dirs:", 1, "Resolving dynamic library dependencies of %s using these dirs:",
path.c_str()); path.c_str());
LogContainer(full_search_paths); LogContainer(full_search_paths);
} }
if (SAPI_VLOG_IS_ON(2)) { if (SAPI_RAW_VLOG_IS_ON(2)) {
SAPI_RAW_VLOG(2, "Direct dependencies of %s to resolve:", path.c_str()); SAPI_RAW_VLOG(2, "Direct dependencies of %s to resolve:", path.c_str());
LogContainer(imported_libs); LogContainer(imported_libs);
} }
@ -531,7 +531,7 @@ absl::Status Mounts::AddMappingsForBinary(const std::string& path,
"Exceeded max entries pending resolving limit"); "Exceeded max entries pending resolving limit");
} }
if (SAPI_VLOG_IS_ON(2)) { if (SAPI_RAW_VLOG_IS_ON(2)) {
SAPI_RAW_VLOG(2, SAPI_RAW_VLOG(2,
"Transitive dependencies of %s to resolve (depth = %d): ", "Transitive dependencies of %s to resolve (depth = %d): ",
resolved_lib.c_str(), depth + 1); resolved_lib.c_str(), depth + 1);

View File

@ -325,7 +325,7 @@ void Namespace::InitializeNamespaces(uid_t uid, gid_t gid, int32_t clone_flags,
"changing mount propagation to private failed"); "changing mount propagation to private failed");
} }
if (SAPI_VLOG_IS_ON(2)) { if (SAPI_RAW_VLOG_IS_ON(2)) {
SAPI_RAW_VLOG(2, "Dumping the sandboxee's filesystem:"); SAPI_RAW_VLOG(2, "Dumping the sandboxee's filesystem:");
LogFilesystem("/"); LogFilesystem("/");
} }

View File

@ -88,6 +88,8 @@
#define SAPI_VLOG_IS_ON(verbose_level) \ #define SAPI_VLOG_IS_ON(verbose_level) \
::sapi::raw_logging_internal::VLogIsOn(verbose_level) ::sapi::raw_logging_internal::VLogIsOn(verbose_level)
#define SAPI_RAW_VLOG_IS_ON(verbose_level) SAPI_VLOG_IS_ON(verbose_level)
#ifndef VLOG #ifndef VLOG
// `VLOG` uses numeric levels to provide verbose logging that can configured at // `VLOG` uses numeric levels to provide verbose logging that can configured at
// runtime, globally. `VLOG` statements are logged at `INFO` severity if they // runtime, globally. `VLOG` statements are logged at `INFO` severity if they