// SPDX-FileCopyrightText: 2017-2026 Hans-Kristian Arntzen // SPDX-FileCopyrightText: 2026 Alex Bates // // SPDX-License-Identifier: MIT // // Replacement for Granite's util/logging.cpp that uses a global (not // thread-local) LoggingInterface, so the command ring worker thread's // messages are also routed through the Rust tracing callback. #include "logging.hpp" #include namespace Util { static std::atomic logging_iface{nullptr}; bool interface_log(const char *tag, const char *fmt, ...) { auto *iface = logging_iface.load(std::memory_order_acquire); if (!iface) return false; va_list va; va_start(va, fmt); bool ret = iface->log(tag, fmt, va); va_end(va); return ret; } void set_thread_logging_interface(LoggingInterface *iface) { logging_iface.store(iface, std::memory_order_release); } }