17#include "sensorring/platform/SensorringExport.hpp"
28class SENSORRING_EXPORT Logger {
44 subscription::Subscription
subscribe(std::function<
void(const
LogVerbosity verbosity, const std::
string& msg)> callback);
72 subscription::Publisher<const
LogVerbosity, const std::
string&> _publisher;
Log verbosity levels for the logger.
LogVerbosity
Verbosity levels for logger output and filtering.
Definition LogVerbosity.hpp:25
Thread-safe, deadlock-free publish/subscribe template.
subscription::Subscription subscribe(std::function< void(const LogVerbosity verbosity, const std::string &msg)> callback)
Subscribe to log messages.
void log(const LogVerbosity verbosity, const std::string &msg) const
Log a message that will be relayed to all registered observers.
void unsubscribe(subscription::SubscriberToken token)
Unsubscribe from log messages.
~Logger()=default
Destructor.
static Logger * getInstance() noexcept
Get a pointer to the instance of the Logger singleton.