Deskflow 1.26.0.207
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
Log.h File Reference
#include "common/LogLevel.h"
#include <list>
#include <mutex>
#include <QString>
Include dependency graph for Log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Log
 Logging facility. More...

Macros

#define CLOG   (Log::getInstance())
#define BYE   "\nTry `%s --help' for more information."
#define LOG(_a1)
#define LOGC(_a1, _a2)
#define CLOG_TRACE   __FILE__, __LINE__,
#define CLOG_TAG_PRINT   "%z\057"
#define CLOG_TAG_CRIT   "%z\060"
#define CLOG_TAG_ERR   "%z\061"
#define CLOG_TAG_WARN   "%z\062"
#define CLOG_TAG_INFO   "%z\063"
#define CLOG_TAG_DEBUG   "%z\064"
#define CLOG_TAG_VERBOSE   "%z\065"
#define CLOG_PRINT   CLOG_TRACE CLOG_TAG_PRINT
#define CLOG_CRIT   CLOG_TRACE CLOG_TAG_CRIT
#define CLOG_ERR   CLOG_TRACE CLOG_TAG_ERR
#define CLOG_WARN   CLOG_TRACE CLOG_TAG_WARN
#define CLOG_INFO   CLOG_TRACE CLOG_TAG_INFO
#define CLOG_DEBUG   CLOG_TRACE CLOG_TAG_DEBUG
#define CLOG_VERBOSE   CLOG_TRACE CLOG_TAG_VERBOSE
#define LOG_PRINT(...)
#define LOG_CRIT(...)
#define LOG_ERR(...)
#define LOG_WARN(...)
#define LOG_INFO(...)
#define LOG_DEBUG(...)
#define LOG_VERBOSE(...)

Macro Definition Documentation

◆ BYE

#define BYE   "\nTry `%s --help' for more information."

◆ CLOG

#define CLOG   (Log::getInstance())

◆ CLOG_CRIT

#define CLOG_CRIT   CLOG_TRACE CLOG_TAG_CRIT

◆ CLOG_DEBUG

#define CLOG_DEBUG   CLOG_TRACE CLOG_TAG_DEBUG

◆ CLOG_ERR

#define CLOG_ERR   CLOG_TRACE CLOG_TAG_ERR

◆ CLOG_INFO

#define CLOG_INFO   CLOG_TRACE CLOG_TAG_INFO

◆ CLOG_PRINT

#define CLOG_PRINT   CLOG_TRACE CLOG_TAG_PRINT

◆ CLOG_TAG_CRIT

#define CLOG_TAG_CRIT   "%z\060"

◆ CLOG_TAG_DEBUG

#define CLOG_TAG_DEBUG   "%z\064"

◆ CLOG_TAG_ERR

#define CLOG_TAG_ERR   "%z\061"

◆ CLOG_TAG_INFO

#define CLOG_TAG_INFO   "%z\063"

◆ CLOG_TAG_PRINT

#define CLOG_TAG_PRINT   "%z\057"

◆ CLOG_TAG_VERBOSE

#define CLOG_TAG_VERBOSE   "%z\065"

◆ CLOG_TAG_WARN

#define CLOG_TAG_WARN   "%z\062"

◆ CLOG_TRACE

#define CLOG_TRACE   __FILE__, __LINE__,

◆ CLOG_VERBOSE

#define CLOG_VERBOSE   CLOG_TRACE CLOG_TAG_VERBOSE

◆ CLOG_WARN

#define CLOG_WARN   CLOG_TRACE CLOG_TAG_WARN

◆ LOG

#define LOG ( _a1)
Value:
CLOG->print _a1
#define CLOG
Definition Log.h:18

Write to the log. Because macros cannot accept variable arguments, this should be invoked like so:

LOG((CLOG_XXX "%d and %d are %s", x, y, x == y ? "equal" : "not equal"));
#define LOG(_a1)
Definition Log.h:185
int y
Definition ServerConfig.cpp:24
int x
Definition ServerConfig.cpp:23

In particular, notice the double open and close parentheses. Also note that there is no comma after the CLOG_XXX. The XXX should be replaced by one of enumerants in Log::LogLevel without the leading k. For example, CLOG_INFO. The special CLOG_PRINT level will not be filtered and is never prefixed by the filename and line number.

If NOLOGGING is defined during the build then this macro expands to nothing. If NDEBUG is defined during the build then it expands to a call to Log::print. Otherwise it expands to a call to Log::print, which includes the filename and line number.

◆ LOG_CRIT

#define LOG_CRIT ( ...)
Value:
LOG((CLOG_CRIT __VA_ARGS__))
#define CLOG_CRIT
Definition Log.h:208

◆ LOG_DEBUG

#define LOG_DEBUG ( ...)
Value:
LOG((CLOG_DEBUG __VA_ARGS__))
#define CLOG_DEBUG
Definition Log.h:212

◆ LOG_ERR

#define LOG_ERR ( ...)
Value:
LOG((CLOG_ERR __VA_ARGS__))
#define CLOG_ERR
Definition Log.h:209

◆ LOG_INFO

#define LOG_INFO ( ...)
Value:
LOG((CLOG_INFO __VA_ARGS__))
#define CLOG_INFO
Definition Log.h:211

◆ LOG_PRINT

#define LOG_PRINT ( ...)
Value:
LOG((CLOG_PRINT __VA_ARGS__))
#define CLOG_PRINT
Definition Log.h:207

◆ LOG_VERBOSE

#define LOG_VERBOSE ( ...)
Value:
LOG((CLOG_VERBOSE __VA_ARGS__))
#define CLOG_VERBOSE
Definition Log.h:213

◆ LOG_WARN

#define LOG_WARN ( ...)
Value:
LOG((CLOG_WARN __VA_ARGS__))
#define CLOG_WARN
Definition Log.h:210

◆ LOGC

#define LOGC ( _a1,
_a2 )
Value:
if (_a1) \
CLOG->print _a2

Write to the log if and only if expr is true. Because macros cannot accept variable arguments, this should be invoked like so:

LOGC(x == y, (CLOG_XXX "%d and %d are equal", x, y));
#define LOGC(_a1, _a2)
Definition Log.h:186

In particular, notice the parentheses around everything after the boolean expression. Also note that there is no comma after the CLOG_XXX. The XXX should be replaced by one of enumerants in Log::LogLevel without the leading k. For example, CLOG_INFO. The special CLOG_PRINT level will not be filtered and is never prefixed by the filename and line number.

If NOLOGGING is defined during the build then this macro expands to nothing. If NDEBUG is not defined during the build then it expands to a call to Log::print that prints the filename and line number, otherwise it expands to a call that doesn't.