Template Class Logger

Class Documentation

template<const char *name>
class Logger

Named lazy access to one Engine-owned category, with configuration before first use.

Template Parameters:

name – Category with static character storage. Equal textual names share Engine registry state across libraries. Keep ProcessLifetime through all callers. Ordinary writes do not resolve the host application’s native default logger.

Public Functions

inline ::CE::Logging::Log<name> &get()

Lazily acquire the named category with profile defaults if not yet initialized.

See also

Detailed guide

Returns:

Borrowed facade; initialization/open errors can propagate and backend reentry rejects. Use initialize() before writers to guarantee explicit settings. Process logging shutdown is terminal.

inline ::CE::Logging::Log<name> &get(::CE::Logging::FileEventHandlers handlers, ::CE::Logging::Config config = ::CE::Logging::Config::for_logger(name))

Acquire the lazy category, using supplied settings only for its first successful construction.

See also

Detailed guide

Parameters:
  • handlers – Owned callbacks if this call creates the category; otherwise ignored.

  • config – Startup configuration if this call creates the category; otherwise ignored.

Returns:

Borrowed Engine-owned category; concurrent creation can wait. Prefer initialize() when repeated explicit configuration must reject.

inline ::CE::Logging::Log<name> &initialize(::CE::Logging::FileEventHandlers handlers = {}, ::CE::Logging::Config config = ::CE::Logging::Config::for_logger(name))

Explicitly initialize this category once before producers or lazy access.

See also

Detailed guide

Parameters:
  • handlers – Owned callbacks with protected capture lifetime.

  • config – Valid initial settings.

Returns:

Borrowed named facade. Repeated explicit initialization, including after prior lazy creation, rejects with bad_request. Opening failures propagate; protected capture/process lifetime remains the caller’s responsibility.

Public Static Functions

static inline LogHandle *get_existing() noexcept

Declaration: [[nodiscard]]

Borrow an already published category without initialization or waiting.

See also

Detailed guide

Returns:

Engine-owned handle, or nullptr when absent, being published, contended or unavailable. Equal textual names find the same state across libraries. Protect the process lifetime while using the borrowed handle.

static inline void set_pattern(const char *fmt)

Acquire the named category and forward set_pattern with the LogHandle contract.

See also

CE::Logging::LogHandle::set_pattern Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline std::filesystem::path get_file_path()

Declaration: [[nodiscard]]

Acquire the named category and forward get_file_path with the LogHandle contract.

See also

CE::Logging::LogHandle::get_file_path Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline const ::CE::Logging::Config &initial_configuration()

Declaration: [[nodiscard]]

Acquire the named category and forward initial_configuration with the LogHandle contract.

See also

CE::Logging::LogHandle::initial_configuration Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline ::CE::Logging::QueueStats shared_queue_stats()

Declaration: [[nodiscard]]

Acquire the named category and forward shared_queue_stats with the LogHandle contract.

See also

CE::Logging::LogHandle::shared_queue_stats Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline ::CE::Logging::BackendStats backend_stats()

Declaration: [[nodiscard]]

Acquire the named category and forward backend_stats with the LogHandle contract.

See also

CE::Logging::LogHandle::backend_stats Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void report_diagnostics()

Acquire the named category and forward report_diagnostics with the LogHandle contract.

See also

CE::Logging::LogHandle::report_diagnostics Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void flush()

Acquire the named category and forward flush with the LogHandle contract.

See also

CE::Logging::LogHandle::flush Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void close(std::chrono::milliseconds timeout = std::chrono::milliseconds::zero())

Acquire the named category and forward close with the LogHandle contract.

See also

CE::Logging::LogHandle::close Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void reopen()

Acquire the named category and forward reopen with the LogHandle contract.

See also

CE::Logging::LogHandle::reopen Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void make_default()

Acquire the named category and forward make_default with the LogHandle contract.

See also

CE::Logging::LogHandle::make_default Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void set_level_logger(::CE::Logging::Level level)

Acquire the named category and forward set_level_logger with the LogHandle contract.

See also

CE::Logging::LogHandle::set_level_logger Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void set_level_filesink(::CE::Logging::Level level)

Acquire the named category and forward set_level_filesink with the LogHandle contract.

See also

CE::Logging::LogHandle::set_level_filesink Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline void set_level_stdsink(::CE::Logging::Level level)

Acquire the named category and forward set_level_stdsink with the LogHandle contract.

See also

CE::Logging::LogHandle::set_level_stdsink Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

static inline bool should_log(const ::CE::Logging::Level level)

Declaration: [[nodiscard]]

Acquire the named category and forward should_log with the LogHandle contract.

See also

CE::Logging::LogHandle::should_log Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

template<::CE::Logging::Compile::LogLevel severity, typename Write>
static inline void write_lazy(Write &&write) noexcept

Evaluate diagnostic preparation only when compilation and destination gates admit it.

See also

Detailed guide

Template Parameters:
  • severity – One compile-time severity bit.

  • Write – Callable accepting Log<name>&.

Parameters:

write – Callable invoked synchronously after admission; not retained when disabled. Initialization, preparation and submission exceptions go to emergency reporting rather than changing the engine operation. This is ordinary logging: call outside locks/native callbacks; callback construction expressions still occur before entry.

template<typename ...Args>
static inline void trace(std::format_string<Args...> fmt, Args&&... args)

Submit a named trace record through LogHandle’s compiled/runtime gates.

See also

CE::Logging::LogHandle::trace Can initialize the category and propagate opening/formatting/submission failures; Block overflow can wait. Use write_lazy() for gated preparation and contained diagnostic failures.

See also

Detailed guide

Template Parameters:

Args – Checked formatting argument types.

Parameters:
  • fmt – Compile-time checked std::format string.

  • args – Forwarded values; argument expressions are evaluated before this call.

template<typename ...Args>
static inline void debug(std::format_string<Args...> fmt, Args&&... args)

Submit a named debug record through LogHandle’s compiled/runtime gates.

See also

CE::Logging::LogHandle::debug Can initialize the category and propagate opening/formatting/submission failures; Block overflow can wait. Use write_lazy() for gated preparation and contained diagnostic failures.

See also

Detailed guide

Template Parameters:

Args – Checked formatting argument types.

Parameters:
  • fmt – Compile-time checked std::format string.

  • args – Forwarded values; argument expressions are evaluated before this call.

template<typename ...Args>
static inline void info(std::format_string<Args...> fmt, Args&&... args)

Submit a named info record through LogHandle’s compiled/runtime gates.

See also

CE::Logging::LogHandle::info Can initialize the category and propagate opening/formatting/submission failures; Block overflow can wait. Use write_lazy() for gated preparation and contained diagnostic failures.

See also

Detailed guide

Template Parameters:

Args – Checked formatting argument types.

Parameters:
  • fmt – Compile-time checked std::format string.

  • args – Forwarded values; argument expressions are evaluated before this call.

template<typename ...Args>
static inline void warn(std::format_string<Args...> fmt, Args&&... args)

Submit a named warn record through LogHandle’s compiled/runtime gates.

See also

CE::Logging::LogHandle::warn Can initialize the category and propagate opening/formatting/submission failures; Block overflow can wait. Use write_lazy() for gated preparation and contained diagnostic failures.

See also

Detailed guide

Template Parameters:

Args – Checked formatting argument types.

Parameters:
  • fmt – Compile-time checked std::format string.

  • args – Forwarded values; argument expressions are evaluated before this call.

template<typename ...Args>
static inline void error(std::format_string<Args...> fmt, Args&&... args)

Submit a named error record through LogHandle’s compiled/runtime gates.

See also

CE::Logging::LogHandle::error Can initialize the category and propagate opening/formatting/submission failures; Block overflow can wait. Use write_lazy() for gated preparation and contained diagnostic failures.

See also

Detailed guide

Template Parameters:

Args – Checked formatting argument types.

Parameters:
  • fmt – Compile-time checked std::format string.

  • args – Forwarded values; argument expressions are evaluated before this call.

template<typename ...Args>
static inline void critical(std::format_string<Args...> fmt, Args&&... args)

Submit a named critical record through LogHandle’s compiled/runtime gates.

See also

CE::Logging::LogHandle::critical Can initialize the category and propagate opening/formatting/submission failures; Block overflow can wait. Use write_lazy() for gated preparation and contained diagnostic failures.

See also

Detailed guide

Template Parameters:

Args – Checked formatting argument types.

Parameters:
  • fmt – Compile-time checked std::format string.

  • args – Forwarded values; argument expressions are evaluated before this call.

static inline void strace(void *addr0 = nullptr)

Acquire the named category and forward strace with the LogHandle contract.

See also

CE::Logging::LogHandle::strace Unlike get_existing(), this can initialize a destination and propagate opening errors. Runtime thresholds do not restore compiled-out severities; lifecycle use requires caller/ProcessLifetime coordination.

See also

Detailed guide

Protected Functions

inline explicit Logger(const ::CE::Logging::FileEventHandlers &event_handlers = {}, ::CE::Logging::Config config = ::CE::Logging::Config::for_logger(name))

Compatibility construction acquiring the lazy category.

See also

Detailed guide

Parameters:
  • event_handlers – Settings used only if this performs first successful construction.

  • config – Configuration used only if this performs first successful construction. Use explicit initialize() before writers when configuration must not be silently ignored.