14#include <flyby/message/client.h>
39 explicit Logger(
const std::string& filepath);
46 explicit Logger(std::shared_ptr<Publisher> publisher);
54 explicit Logger(std::shared_ptr<Publisher> publisher,
const std::string& filepath);
87 virtual void log(
LogLevel level,
const std::string& tag,
const std::string& message);
94 virtual void d(
const std::string& message);
102 virtual void d(
const std::string& tag,
const std::string& message);
109 virtual void i(
const std::string& message);
117 virtual void i(
const std::string& tag,
const std::string& message);
124 virtual void w(
const std::string& message);
132 virtual void w(
const std::string& tag,
const std::string& message);
139 virtual void e(
const std::string& message);
147 virtual void e(
const std::string& tag,
const std::string& message);
160 bool m_allow_stdout {
false };
162 LogLevel m_level { LogLevel::INFO };
164 std::ofstream m_file_stream;
165 std::shared_ptr<Publisher> m_publisher;
virtual void e(const std::string &tag, const std::string &message)
Logs a message at the error log level.
virtual void log(LogLevel level, const std::string &tag, const std::string &message)
Logs a message at a log level.
virtual void log(LogLevel level, const std::string &message)
Logs a message at a log level.
virtual void w(const std::string &tag, const std::string &message)
Logs a message at the warning log level.
void set_log_level(LogLevel level)
Sets the current log level.
virtual void d(const std::string &tag, const std::string &message)
Logs a message at the debug log level.
void set_stdout(bool allow_stdout)
Allow/stop the logger from outputting to stdout.
Logger(const std::string &filepath)
Constructs a logger that writes to a file.
virtual void i(const std::string &message)
Logs a message at the info log level.
Logger(std::shared_ptr< Publisher > publisher, const std::string &filepath)
Constructs a logger that writes to the message bus and to a file.
virtual void d(const std::string &message)
Logs a message at the debug log level.
virtual void e(const std::string &message)
Logs a message at the error log level.
Logger(std::shared_ptr< Publisher > publisher)
Constructs a logger that writes to the message bus.
Logger()
Constructs an empty logger.
virtual void i(const std::string &tag, const std::string &message)
Logs a message at the info log level.
virtual void w(const std::string &message)
Logs a message at the warning log level.
LogLevel
The log level that is displayed with the message in the log.
Definition log.h:21