[cr149] rust_logger was split into smaller modules.
Also, verbose param has been removed from the print_rust_log function signature. Chromium changes: https://chromium.googlesource.com/chromium/src.git/+/fafff21 commit fafff21030e1c11d6bbb1acccd6b28013cfd887f Author: Lukasz Anforowicz <lukasza@chromium.org> Date: Tue Apr 7 17:28:03 2026 -0700 [rust] Split the `rust_logger` crate into smaller modules. This helps to hide some implementation details as private items of the new, smaller modules. In addition to moving the new modules into `//base/logging/rust_logger` subdirectory, this CL also moves tests into the same directory. Summary of the changes/moves: * `base/logging/logger.rs` has been split into 4 modules: - `base/logging/rust_logger/lib.rs` (entry point via C API) - `base/logging/rust_logger/log_crate_integration.rs` and `base/logging/rust_logger/custom_panic_hook.rs` - `base/logging/rust_logger/print_rust_log.rs` (low-level implementation for invoking `LOG(...)` from Rust). * `base/logging/rust_log_integration.h/.cc` has been moved to `base/logging/rust_logger/print_rust_log_ffi.h/.cc` * `base/test/logging/test_rust_logger_consumer.rs` has been moved to `base/logging/rust_logger/test_support.rs` * `base/logging/rust_log_integration_unittest.cc` has been moved to `base/logging/rust_logger/unittests.cc` Bug: 495537792 https://chromium.googlesource.com/chromium/src.git/+/750f91c315307c59cb4f4b2445642e97187e620f commit 750f91c315307c59cb4f4b2445642e97187e620f Author: Lukasz Anforowicz <lukasza@chromium.org> Date: Wed Apr 8 16:25:46 2026 -0700 [rust] Delete unfinished `VLOG(INFO)` <=> Rust integration. Bug: 495537792
This commit is contained in:
+11
-14
@@ -3,33 +3,31 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "base/logging/rust_log_integration.h"
|
||||
#include "base/logging/rust_logger/print_rust_log_ffi.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
|
||||
#define print_rust_log print_rust_log_chromium_impl
|
||||
#include <base/logging/rust_log_integration.cc>
|
||||
#include <base/logging/rust_logger/print_rust_log_ffi.cc>
|
||||
#undef print_rust_log
|
||||
|
||||
namespace logging {
|
||||
namespace internal {
|
||||
namespace logging::internal {
|
||||
|
||||
void print_rust_log(const RustFmtArguments& msg,
|
||||
const char* file,
|
||||
int32_t line,
|
||||
int32_t severity,
|
||||
bool verbose) {
|
||||
int32_t severity) {
|
||||
switch (severity) {
|
||||
// Trace and debug logs are set as `LOGGING_INFO`. Trace is also set as
|
||||
// verbose, so we make a higher level verbosity. We also map `LOGGING_WARN`
|
||||
// to verbose, to avoid "excessive output" errors in unit tests.
|
||||
// Trace and debug logs are set as `LOGGING_INFO`. We also map
|
||||
// `LOGGING_WARN` to verbose, to avoid "excessive output" errors in unit
|
||||
// tests.
|
||||
case LOGGING_INFO:
|
||||
case LOGGING_WARNING:
|
||||
severity = LOGGING_VERBOSE - verbose;
|
||||
severity = LOGGING_VERBOSE;
|
||||
break;
|
||||
default:
|
||||
// All other cases are handled by the upstream version.
|
||||
print_rust_log_chromium_impl(msg, file, line, severity, verbose);
|
||||
print_rust_log_chromium_impl(msg, file, line, severity);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,8 +35,7 @@ void print_rust_log(const RustFmtArguments& msg,
|
||||
return;
|
||||
}
|
||||
|
||||
print_rust_log_chromium_impl(msg, file, line, severity, verbose);
|
||||
print_rust_log_chromium_impl(msg, file, line, severity);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace logging
|
||||
} // namespace logging::internal
|
||||
Reference in New Issue
Block a user