10#ifndef CPPTRAIL_SYNC_LOGGER_H
11#define CPPTRAIL_SYNC_LOGGER_H
28 template<
typename char_t>
71 std::unique_lock<std::mutex> oLock(this->m_oGeneralMutex);
74 this->
work(std::move(oMessage));
83 std::unique_lock<std::mutex> oLock(this->m_oGeneralMutex);
92 std::unique_lock<std::mutex> oLock(this->m_oGeneralMutex);
102 std::unique_lock<std::mutex> oLock(this->m_oGeneralMutex);
118 std::unique_lock<std::mutex> oLock(this->m_oGeneralMutex);
141 std::mutex m_oGeneralMutex;
154#if __cplusplus >= 202002L
Core logging interfaces and high-level handle abstractions.
Abstract template interface defining the mandatory contract for all loggers.
Definition base_logger.h:28
char_t char_type
Alias for the underlying character type used by this logger.
Definition base_logger.h:31
std::basic_string< char_type > string_type
Alias for the basic_string type associated with this logger's encoding.
Definition base_logger.h:34
Container for log message implementations.
Definition message.h:76
A synchronous, thread-safe logger implementation template. This class ensures that every log call is ...
Definition sync_logger.h:29
typename BasicLoggerImpl< char_t >::string_type string_type
Alias for the basic_string type associated with this logger's encoding.
Definition sync_logger.h:35
typename BasicLoggerImpl< char_t >::message_type message_type
Alias for the BasicMessage type associated to the logger.
Definition sync_logger.h:38
typename BasicLoggerImpl< char_t >::char_type char_type
Alias for the underlying character type used by this logger.
Definition sync_logger.h:32
virtual Status serviceStatus()=0
Non-locking call to get the current service status.
void join() override
Waits for the asynchronous end of the shutdown sequence.
Definition sync_logger.h:110
Status status() final
Retrieves the current status of the service.
Definition sync_logger.h:117
virtual void work(message_type oMessage)=0
Abstract method where the actual logging I/O occurs.
void stop() final
Stops the logger service.
Definition sync_logger.h:91
void signalStop() final
Signals the logger to stop.
Definition sync_logger.h:101
void log(message_type oMessage) final
Synchronously processes and records a log message.
Definition sync_logger.h:70
virtual void serviceStop()=0
Non-locking call to initiate service shutdown.
void start() final
Starts the logger service.
Definition sync_logger.h:82
virtual void serviceStart()=0
Non-locking call to initiate service startup.
~BasicSyncLoggerImpl() override=default
Destructor.
Root namespace for the CppTrail logging library.
Definition async_logger.h:24
Status
Represents the current operational state of a Logger implementation.
Definition def.h:31
@ TRASCENDENT
The logger operates outside standard lifecycle management.
@ RUNNING
The logger is active and processing entries.