17#define CLOG (Log::getInstance())
18#define BYE "\nTry `%s --help' for more information."
33 explicit Log(
bool singleton =
true);
78 void pop_front(
bool alwaysAtHead =
false);
103 void print(
const char *file,
int line,
const char *format, ...);
127 void output(
LogLevel priority,
const char *msg);
130 using OutputterList = std::list<ILogOutputter *>;
134 mutable std::mutex m_mutex;
135 OutputterList m_outputters;
136 OutputterList m_alwaysOutputters;
179#if defined(NOLOGGING)
181#define LOGC(_a1, _a2)
184#define LOG(_a1) CLOG->print _a1
185#define LOGC(_a1, _a2) \
188#define CLOG_TRACE nullptr, 0,
190#define LOG(_a1) CLOG->print _a1
191#define LOGC(_a1, _a2) \
194#define CLOG_TRACE __FILE__, __LINE__,
202#define CLOG_IPC CLOG_TRACE "%z\056"
203#define CLOG_PRINT CLOG_TRACE "%z\057"
204#define CLOG_CRIT CLOG_TRACE "%z\060"
205#define CLOG_ERR CLOG_TRACE "%z\061"
206#define CLOG_WARN CLOG_TRACE "%z\062"
207#define CLOG_NOTE CLOG_TRACE "%z\063"
208#define CLOG_INFO CLOG_TRACE "%z\064"
209#define CLOG_DEBUG CLOG_TRACE "%z\065"
210#define CLOG_DEBUG1 CLOG_TRACE "%z\066"
211#define CLOG_DEBUG2 CLOG_TRACE "%z\067"
212#define CLOG_DEBUG3 CLOG_TRACE "%z\070"
213#define CLOG_DEBUG4 CLOG_TRACE "%z\071"
214#define CLOG_DEBUG5 CLOG_TRACE "%z\072"
216#define LOG_IPC(...) LOG((CLOG_IPC __VA_ARGS__))
217#define LOG_PRINT(...) LOG((CLOG_PRINT __VA_ARGS__))
218#define LOG_CRIT(...) LOG((CLOG_CRIT __VA_ARGS__))
219#define LOG_ERR(...) LOG((CLOG_ERR __VA_ARGS__))
220#define LOG_WARN(...) LOG((CLOG_WARN __VA_ARGS__))
221#define LOG_NOTE(...) LOG((CLOG_NOTE __VA_ARGS__))
222#define LOG_INFO(...) LOG((CLOG_INFO __VA_ARGS__))
223#define LOG_DEBUG(...) LOG((CLOG_DEBUG __VA_ARGS__))
224#define LOG_DEBUG1(...) LOG((CLOG_DEBUG1 __VA_ARGS__))
225#define LOG_DEBUG2(...) LOG((CLOG_DEBUG2 __VA_ARGS__))
226#define LOG_DEBUG3(...) LOG((CLOG_DEBUG3 __VA_ARGS__))
227#define LOG_DEBUG4(...) LOG((CLOG_DEBUG4 __VA_ARGS__))
228#define LOG_DEBUG5(...) LOG((CLOG_DEBUG5 __VA_ARGS__))
static const struct sockaddr FAR * name
Definition ArchNetworkWinsock.cpp:28
static int level
Definition ArchNetworkWinsock.cpp:31
LogLevel
Log levels.
Definition LogLevel.h:15
@ Debug2
For verbosity +2 debugging messages.
Definition LogLevel.h:25
Outputter interface.
Definition ILogOutputter.h:21
Logging facility.
Definition Log.h:31
~Log()
Definition Log.cpp:135
void print(const char *file, int line, const char *format,...)
Print a log message.
Definition Log.cpp:166
LogLevel getConsoleMaxLevel() const
Definition Log.h:119
LogLevel getFilter() const
Get the minimum priority level.
Definition Log.cpp:255
void insert(ILogOutputter *adoptedOutputter, bool alwaysAtHead=false)
Add an outputter to the head of the list and adopts it.
Definition Log.cpp:203
static Log * getInstance()
Get the singleton instance of the log.
Definition Log.cpp:146
Log & operator=(Log const &)=delete
Log & operator=(Log &&)=delete
Log(bool singleton=true)
Definition Log.cpp:115
void pop_front(bool alwaysAtHead=false)
Remove the outputter from the head of the list.
Definition Log.cpp:224
bool setFilter(const QString &name)
Set the minimum priority filter.
Definition Log.cpp:234
const char * getFilterName() const
Get the filter name of the current filter level.
Definition Log.cpp:152
void remove(ILogOutputter *orphaned)
Remove an outputter from the list.
Definition Log.cpp:217
Thread handle.
Definition Thread.h:33