threadman 0.1.0
Header-only C++23 managed threads, dynamic pools, futures, and executors
Loading...
Searching...
No Matches
Namespaces | Functions
log.hpp File Reference

Cached subsystem loggers for the tm. More...

#include <logman/logman.hpp>
#include <spdlog/spdlog.h>
#include <memory>
Include dependency graph for log.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  threadman
 
namespace  threadman::log
 

Functions

std::shared_ptr< spdlog::logger > & threadman::log::pool ()
 Logger for tm.pool — scaling, shutdown, queue back-pressure.
 
std::shared_ptr< spdlog::logger > & threadman::log::thread ()
 Logger for tm.threadManagedThread lifecycle and faults.
 
std::shared_ptr< spdlog::logger > & threadman::log::future ()
 Logger for tm.future — future satisfaction and continuation dispatch.
 
std::shared_ptr< spdlog::logger > & threadman::log::manager ()
 Logger for tm.manager — housekeeper lifecycle, listener faults.
 
std::shared_ptr< spdlog::logger > & threadman::log::task ()
 Logger for tm.task — stuck-task warnings (only when no listener subscribes).
 
std::shared_ptr< spdlog::logger > & threadman::log::executor ()
 Logger for tm.executor — executor wiring and dispatch.
 

Detailed Description

Cached subsystem loggers for the tm.

* channels.

Each accessor returns a long-lived shared_ptr<spdlog::logger> created on first call via logman::get(...). The pointer is cached in a static-local, so subsequent calls are a no-op load; hot paths can additionally gate on lg->should_log(level) before evaluating a format string.

Logger initialization is the consumer application's responsibility — call logman::initialize(...) and (optionally) logman::set_levels_by_prefix( "tm.", level) once at startup. This header never calls initialize() itself; it just calls get(...), which lazily creates the channel using whatever defaults the application configured (or logman's built-in info- level default if none).