Template Class Log
Defined in File log.h
Class Documentation
-
template<const char *name>
class Log Public Functions
-
explicit Log(spdlog::file_event_handlers event_handlers = {}, ::CE::Logging::Config configuration = ::CE::Logging::Config::for_logger(name))
-
~Log() noexcept
-
inline const ::CE::Logging::Config &initial_configuration() const noexcept
Declaration:
[[nodiscard]]Owned immutable startup settings with an absolute directory.
Live level setters affect the current generation and are preserved by close/reopen.
Declaration:
[[nodiscard]]Observe all categories using this pool, including discarded flush requests.
This is not a per-Log count or an atomic pair of values. Available while closed; does not reset the shared counters.
-
inline ::CE::Logging::BackendStats backend_stats() const noexcept
Declaration:
[[nodiscard]]
-
inline void report_diagnostics() const
Emit coalesced loss/failure counters through bounded stdio outside lifecycle locks.
Available while closed; also called by completed close.
-
std::filesystem::path get_file_path() const
Declaration:
[[nodiscard]]
-
uint16_t get_log_id() const
Declaration:
[[nodiscard]]
-
void flush() const
Queue a flush with this Log’s overflow policy.
Block can wait for capacity; DiscardNew can lose the request. No backend acknowledgement is returned. Completed close releases accepted file owners after the producers have stopped; it does not promise physical durability.
-
void close(std::chrono::milliseconds timeout = std::chrono::milliseconds::zero())
-
void reopen()
-
void make_default() const
-
inline bool should_log(const spdlog::level level) const noexcept
Declaration:
[[nodiscard]]A best-effort probe of compile, logger, and actual sink filters.
Level changes/close may race a later write; retaining the published logger here keeps this probe’s sink graph alive. The native graph is fixed. Probe before evaluating expensive log arguments.
-
inline void set_pattern(const char *fmt) const
-
inline void set_pattern_filesink(const char *fmt) const
-
inline void set_pattern_stdsink(const char *fmt) const
-
inline void strace(void *addr0 = nullptr) const
-
template<typename ...Args>
inline void critical(spdlog::format_string_t<Args...> fmt, Args&&... args)
Protected Functions
Declaration:
[[nodiscard]]
-
void require_open_state(const LogStateController::Lock &lock, const char *operation) const
Protected Attributes
-
uint16_t log_id = 0
-
atomic_shared_ptr<spdlog::logger> m_logger = {nullptr}
-
atomic_shared_ptr<spdlog::sinks::rotating_file_sink_mt> m_file = {nullptr}
-
atomic_shared_ptr<::CE::Logging::Sinks::ThreadSafeOutputSink> m_console = {nullptr}
-
explicit Log(spdlog::file_event_handlers event_handlers = {}, ::CE::Logging::Config configuration = ::CE::Logging::Config::for_logger(name))