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)
| 201 | /// atomically inside OnceLock, so concurrent calls cannot produce |
| 202 | /// duplicate worker threads. |
| 203 | pub 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. |
| 208 | fn logger() -> Option<&'static TelemetryLogger> { |
no outgoing calls