MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / init_logger_once

Function init_logger_once

src/telemetry.rs:203–205  ·  view source on GitHub ↗

Initialize the global telemetry logger if not already initialized, returning the existing or new logger. This is the thread-safe path: creation and registration happen atomically inside OnceLock, so concurrent calls cannot produce duplicate worker threads.

(log_dir: PathBuf)

Source from the content-addressed store, hash-verified

201/// atomically inside OnceLock, so concurrent calls cannot produce
202/// duplicate worker threads.
203pub fn init_logger_once(log_dir: PathBuf) -> &'static TelemetryLogger {
204 LOGGER.get_or_init(|| TelemetryLogger::new(log_dir))
205}
206
207/// Get a reference to the global logger, if initialized.
208fn logger() -> Option<&'static TelemetryLogger> {

Callers 2

mainFunction · 0.85

Calls

no outgoing calls

Tested by 1