17#include "sensorring/platform/SensorringExport.hpp"
30class SENSORRING_EXPORT Logger {
46 subscription::Subscription
subscribe(std::function<
void(const
LogVerbosity verbosity, const std::
string& msg)> callback);
74 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:27
Thread-safe, deadlock-free publish/subscribe template.
void unsubscribe(subscription::SubscriberToken token)
Unsubscribe from log messages.
subscription::Subscription subscribe(std::function< void(const LogVerbosity verbosity, const std::string &msg)> callback)
Subscribe to log messages.
static Logger * getInstance() noexcept
Get a pointer to the instance of the Logger singleton.
~Logger()=default
Destructor.
void log(const LogVerbosity verbosity, const std::string &msg) const
Log a message that will be relayed to all registered observers.