18#define CLOG (Log::getInstance())
19#define BYE "\nTry `%s --help' for more information."
34 explicit Log(
bool singleton =
true);
79 void pop_front(
bool alwaysAtHead =
false);
104 void print(
const char *file,
int line,
const char *format, ...);
125 using OutputterList = std::list<ILogOutputter *>;
129 mutable std::mutex m_mutex;
130 OutputterList m_outputters;
131 OutputterList m_alwaysOutputters;
174#if defined(NOLOGGING)
176#define LOGC(_a1, _a2)
179#define LOG(_a1) CLOG->print _a1
180#define LOGC(_a1, _a2) \
183#define CLOG_TRACE nullptr, 0,
185#define LOG(_a1) CLOG->print _a1
186#define LOGC(_a1, _a2) \
189#define CLOG_TRACE __FILE__, __LINE__,
199#define CLOG_TAG_PRINT "%z\057"
200#define CLOG_TAG_CRIT "%z\060"
201#define CLOG_TAG_ERR "%z\061"
202#define CLOG_TAG_WARN "%z\062"
203#define CLOG_TAG_INFO "%z\063"
204#define CLOG_TAG_DEBUG "%z\064"
205#define CLOG_TAG_VERBOSE "%z\065"
207#define CLOG_PRINT CLOG_TRACE CLOG_TAG_PRINT
208#define CLOG_CRIT CLOG_TRACE CLOG_TAG_CRIT
209#define CLOG_ERR CLOG_TRACE CLOG_TAG_ERR
210#define CLOG_WARN CLOG_TRACE CLOG_TAG_WARN
211#define CLOG_INFO CLOG_TRACE CLOG_TAG_INFO
212#define CLOG_DEBUG CLOG_TRACE CLOG_TAG_DEBUG
213#define CLOG_VERBOSE CLOG_TRACE CLOG_TAG_VERBOSE
215#define LOG_PRINT(...) LOG((CLOG_PRINT __VA_ARGS__))
216#define LOG_CRIT(...) LOG((CLOG_CRIT __VA_ARGS__))
217#define LOG_ERR(...) LOG((CLOG_ERR __VA_ARGS__))
218#define LOG_WARN(...) LOG((CLOG_WARN __VA_ARGS__))
219#define LOG_INFO(...) LOG((CLOG_INFO __VA_ARGS__))
220#define LOG_DEBUG(...) LOG((CLOG_DEBUG __VA_ARGS__))
221#define LOG_VERBOSE(...) LOG((CLOG_VERBOSE __VA_ARGS__))
static const struct sockaddr FAR * name
Definition ArchNetworkWinsock.cpp:28
Outputter interface.
Definition ILogOutputter.h:21
Level
Log levels.
Definition LogLevel.h:22
@ Verbose
For verbose debugging messages.
Definition LogLevel.h:29
Logging facility.
Definition Log.h:32
~Log()
Definition Log.cpp:126
void print(const char *file, int line, const char *format,...)
Print a log message.
Definition Log.cpp:143
LogLevel::Level getConsoleMaxLevel() const
Definition Log.h:114
void insert(ILogOutputter *adoptedOutputter, bool alwaysAtHead=false)
Add an outputter to the head of the list and adopts it.
Definition Log.cpp:180
LogLevel::Level getFilter() const
Get the minimum priority level.
Definition Log.cpp:226
static Log * getInstance()
Get the singleton instance of the log.
Definition Log.cpp:137
Log & operator=(Log const &)=delete
Log & operator=(Log &&)=delete
Log(bool singleton=true)
Definition Log.cpp:106
void pop_front(bool alwaysAtHead=false)
Remove the outputter from the head of the list.
Definition Log.cpp:201
bool setFilter(const QString &name)
Set the minimum priority filter.
Definition Log.cpp:211
void remove(ILogOutputter *orphaned)
Remove an outputter from the list.
Definition Log.cpp:194
Thread handle.
Definition Thread.h:33