Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
Log.h File Reference
#include "arch/Arch.h"
#include "arch/IArchMultithread.h"
#include "common/Common.h"
#include <mutex>
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_PRINT   CLOG_TRACE "%z\057"
#define CLOG_CRIT   CLOG_TRACE "%z\060"
#define CLOG_ERR   CLOG_TRACE "%z\061"
#define CLOG_WARN   CLOG_TRACE "%z\062"
#define CLOG_NOTE   CLOG_TRACE "%z\063"
#define CLOG_INFO   CLOG_TRACE "%z\064"
#define CLOG_DEBUG   CLOG_TRACE "%z\065"
#define CLOG_DEBUG1   CLOG_TRACE "%z\066"
#define CLOG_DEBUG2   CLOG_TRACE "%z\067"
#define CLOG_DEBUG3   CLOG_TRACE "%z\070"
#define CLOG_DEBUG4   CLOG_TRACE "%z\071"
#define CLOG_DEBUG5   CLOG_TRACE "%z\072"
#define LOG_PRINT(...)
#define LOG_CRIT(...)
#define LOG_ERR(...)
#define LOG_WARN(...)
#define LOG_NOTE(...)
#define LOG_INFO(...)
#define LOG_DEBUG(...)
#define LOG_DEBUG1(...)
#define LOG_DEBUG2(...)
#define LOG_DEBUG3(...)
#define LOG_DEBUG4(...)
#define LOG_DEBUG5(...)

Macro Definition Documentation

◆ BYE

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

◆ CLOG

#define CLOG   (Log::getInstance())

◆ CLOG_CRIT

#define CLOG_CRIT   CLOG_TRACE "%z\060"

◆ CLOG_DEBUG

#define CLOG_DEBUG   CLOG_TRACE "%z\065"

◆ CLOG_DEBUG1

#define CLOG_DEBUG1   CLOG_TRACE "%z\066"

◆ CLOG_DEBUG2

#define CLOG_DEBUG2   CLOG_TRACE "%z\067"

◆ CLOG_DEBUG3

#define CLOG_DEBUG3   CLOG_TRACE "%z\070"

◆ CLOG_DEBUG4

#define CLOG_DEBUG4   CLOG_TRACE "%z\071"

◆ CLOG_DEBUG5

#define CLOG_DEBUG5   CLOG_TRACE "%z\072"

◆ CLOG_ERR

#define CLOG_ERR   CLOG_TRACE "%z\061"

◆ CLOG_INFO

#define CLOG_INFO   CLOG_TRACE "%z\064"

◆ CLOG_NOTE

#define CLOG_NOTE   CLOG_TRACE "%z\063"

◆ CLOG_PRINT

#define CLOG_PRINT   CLOG_TRACE "%z\057"

◆ CLOG_TRACE

#define CLOG_TRACE   __FILE__, __LINE__,

◆ CLOG_WARN

#define CLOG_WARN   CLOG_TRACE "%z\062"

◆ LOG

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

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:189
int y
Definition ServerConfig.cpp:27
int x
Definition ServerConfig.cpp:26

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:202

◆ LOG_DEBUG

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

◆ LOG_DEBUG1

#define LOG_DEBUG1 ( ...)
Value:
LOG((CLOG_DEBUG1 __VA_ARGS__))
#define CLOG_DEBUG1
Definition Log.h:208

◆ LOG_DEBUG2

#define LOG_DEBUG2 ( ...)
Value:
LOG((CLOG_DEBUG2 __VA_ARGS__))
#define CLOG_DEBUG2
Definition Log.h:209

◆ LOG_DEBUG3

#define LOG_DEBUG3 ( ...)
Value:
LOG((CLOG_DEBUG3 __VA_ARGS__))
#define CLOG_DEBUG3
Definition Log.h:210

◆ LOG_DEBUG4

#define LOG_DEBUG4 ( ...)
Value:
LOG((CLOG_DEBUG4 __VA_ARGS__))
#define CLOG_DEBUG4
Definition Log.h:211

◆ LOG_DEBUG5

#define LOG_DEBUG5 ( ...)
Value:
LOG((CLOG_DEBUG5 __VA_ARGS__))
#define CLOG_DEBUG5
Definition Log.h:212

◆ LOG_ERR

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

◆ LOG_INFO

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

◆ LOG_NOTE

#define LOG_NOTE ( ...)
Value:
LOG((CLOG_NOTE __VA_ARGS__))
#define CLOG_NOTE
Definition Log.h:205

◆ LOG_PRINT

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

◆ LOG_WARN

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

◆ 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:190

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.