16#define CLOG (Log::getInstance())
17#define BYE "\nTry `%s --help' for more information."
32 explicit Log(
bool singleton =
true);
77 void pop_front(
bool alwaysAtHead =
false);
102 void print(
const char *file,
int line,
const char *format, ...);
126 void output(
LogLevel priority,
const char *msg);
129 using OutputterList = std::list<ILogOutputter *>;
133 mutable std::mutex m_mutex;
134 OutputterList m_outputters;
135 OutputterList m_alwaysOutputters;
178#if defined(NOLOGGING)
180#define LOGC(_a1, _a2)
183#define LOG(_a1) CLOG->print _a1
184#define LOGC(_a1, _a2) \
187#define CLOG_TRACE nullptr, 0,
189#define LOG(_a1) CLOG->print _a1
190#define LOGC(_a1, _a2) \
193#define CLOG_TRACE __FILE__, __LINE__,
201#define CLOG_PRINT CLOG_TRACE "%z\057"
202#define CLOG_CRIT CLOG_TRACE "%z\060"
203#define CLOG_ERR CLOG_TRACE "%z\061"
204#define CLOG_WARN CLOG_TRACE "%z\062"
205#define CLOG_NOTE CLOG_TRACE "%z\063"
206#define CLOG_INFO CLOG_TRACE "%z\064"
207#define CLOG_DEBUG CLOG_TRACE "%z\065"
208#define CLOG_DEBUG1 CLOG_TRACE "%z\066"
209#define CLOG_DEBUG2 CLOG_TRACE "%z\067"
210#define CLOG_DEBUG3 CLOG_TRACE "%z\070"
211#define CLOG_DEBUG4 CLOG_TRACE "%z\071"
212#define CLOG_DEBUG5 CLOG_TRACE "%z\072"
214#define LOG_PRINT(...) LOG((CLOG_PRINT __VA_ARGS__))
215#define LOG_CRIT(...) LOG((CLOG_CRIT __VA_ARGS__))
216#define LOG_ERR(...) LOG((CLOG_ERR __VA_ARGS__))
217#define LOG_WARN(...) LOG((CLOG_WARN __VA_ARGS__))
218#define LOG_NOTE(...) LOG((CLOG_NOTE __VA_ARGS__))
219#define LOG_INFO(...) LOG((CLOG_INFO __VA_ARGS__))
220#define LOG_DEBUG(...) LOG((CLOG_DEBUG __VA_ARGS__))
221#define LOG_DEBUG1(...) LOG((CLOG_DEBUG1 __VA_ARGS__))
222#define LOG_DEBUG2(...) LOG((CLOG_DEBUG2 __VA_ARGS__))
223#define LOG_DEBUG3(...) LOG((CLOG_DEBUG3 __VA_ARGS__))
224#define LOG_DEBUG4(...) LOG((CLOG_DEBUG4 __VA_ARGS__))
225#define LOG_DEBUG5(...) LOG((CLOG_DEBUG5 __VA_ARGS__))
static const struct sockaddr FAR * name
Definition ArchNetworkWinsock.cpp:27
static int level
Definition ArchNetworkWinsock.cpp:30
LogLevel
Log levels.
Definition LogLevel.h:15
@ Debug2
For verbosity +2 debugging messages.
Definition LogLevel.h:24
Outputter interface.
Definition ILogOutputter.h:21
Logging facility.
Definition Log.h:30
~Log()
Definition Log.cpp:142
bool setFilter(const char *name)
Set the minimum priority filter.
Definition Log.cpp:241
void print(const char *file, int line, const char *format,...)
Print a log message.
Definition Log.cpp:173
LogLevel getConsoleMaxLevel() const
Definition Log.h:118
LogLevel getFilter() const
Get the minimum priority level.
Definition Log.cpp:261
void insert(ILogOutputter *adoptedOutputter, bool alwaysAtHead=false)
Add an outputter to the head of the list and adopts it.
Definition Log.cpp:210
static Log * getInstance()
Get the singleton instance of the log.
Definition Log.cpp:153
Log & operator=(Log const &)=delete
Log & operator=(Log &&)=delete
Log(bool singleton=true)
Definition Log.cpp:122
void pop_front(bool alwaysAtHead=false)
Remove the outputter from the head of the list.
Definition Log.cpp:231
const char * getFilterName() const
Get the filter name of the current filter level.
Definition Log.cpp:159
void remove(ILogOutputter *orphaned)
Remove an outputter from the list.
Definition Log.cpp:224
Thread handle.
Definition Thread.h:33