Go to the documentation of this file.
25 #ifndef __XRD_CL_LOG_HH__
26 #define __XRD_CL_LOG_HH__
41 #if __cplusplus >= 201103L
60 virtual void Write(
const std::string &message ) = 0;
75 bool Open(
const std::string &fileName );
81 virtual void Write(
const std::string &message );
92 virtual void Write(
const std::string &message );
124 for(
int i = 0; i < maxMask; ++i )
125 pMask[i] = 0xffffffffffffffffULL;
139 void Error( uint64_t topic,
const char *format, ... );
144 void Warning( uint64_t topic,
const char *format, ... );
149 void Info( uint64_t topic,
const char *format, ... );
154 void Debug( uint64_t topic,
const char *format, ... );
159 void Dump( uint64_t topic,
const char *format, ... );
169 void Say(
LogLevel level, uint64_t topic,
const char *format, va_list list );
176 #if __cplusplus >= 201103L
177 pLevel.store(level, std::memory_order_relaxed);
213 void SetMask(
const std::string &level, uint64_t mask )
230 #if __cplusplus >= 201103L
252 #if __cplusplus >= 201103L
253 std::atomic<LogLevel>
pLevel;
265 #endif // __XRD_CL_LOG_HH__
LogLevel pLevel
Definition: XrdClLog.hh:255
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
Write log messages to a file.
Definition: XrdClLog.hh:66
Definition: XrdSysPthread.hh:165
void Close()
Close the log file.
virtual ~LogOutCerr()
Definition: XrdClLog.hh:93
void SetMask(LogLevel level, uint64_t mask)
Sets the mask for the topics of messages that should be printed.
Definition: XrdClLog.hh:205
bool Open(const std::string &fileName)
Open the log file.
bool StringToLogLevel(const std::string &strLevel, LogLevel &level)
Handle diagnostics.
Definition: XrdClLog.hh:101
void Warning(uint64_t topic, const char *format,...)
Report a warning.
std::string LogLevelToString(LogLevel level)
void SetPid(pid_t pid)
Set pid.
Definition: XrdClLog.hh:241
uint32_t pTopicMaxLength
Definition: XrdClLog.hh:260
XrdSysMutex pMutex
Definition: XrdClLog.hh:95
@ WarningMsg
report warnings
Definition: XrdClLog.hh:111
TopicMap pTopicMap
Definition: XrdClLog.hh:259
virtual void Write(const std::string &message)=0
void Say(LogLevel level, uint64_t topic, const char *format, va_list list)
virtual ~LogOutFile()
Definition: XrdClLog.hh:70
std::string TopicToString(uint64_t topic)
LogOutFile()
Definition: XrdClLog.hh:69
std::map< uint64_t, std::string > TopicMap
Definition: XrdClLog.hh:247
void Error(uint64_t topic, const char *format,...)
Report an error.
~Log()
Definition: XrdClLog.hh:131
LogLevel GetLevel() const
Get the log level.
Definition: XrdClLog.hh:228
virtual void Write(const std::string &message)
LogOut * pOutput
Definition: XrdClLog.hh:258
void SetLevel(LogLevel level)
Set the level of the messages that should be sent to the destination.
Definition: XrdClLog.hh:174
@ InfoMsg
print info
Definition: XrdClLog.hh:112
LogLevel
Log levels.
Definition: XrdClLog.hh:107
void SetMask(const std::string &level, uint64_t mask)
Sets the mask for the topics of messages that should be printed.
Definition: XrdClLog.hh:213
pid_t pPid
Definition: XrdClLog.hh:261
void Info(uint64_t topic, const char *format,...)
Print an info.
virtual ~LogOut()
Definition: XrdClLog.hh:53
void Dump(uint64_t topic, const char *format,...)
Print a dump message.
Write log messages to stderr.
Definition: XrdClLog.hh:89
@ DebugMsg
print debug info
Definition: XrdClLog.hh:113
Definition: XrdClAnyObject.hh:25
Interface for logger outputs.
Definition: XrdClLog.hh:50
@ ErrorMsg
report errors
Definition: XrdClLog.hh:110
int pFileDes
Definition: XrdClLog.hh:83
void SetOutput(LogOut *output)
Set the output that should be used.
Definition: XrdClLog.hh:196
Log()
Constructor.
Definition: XrdClLog.hh:120
void SetLevel(const std::string &level)
Set the level of the messages that should be sent to the destination.
Definition: XrdClLog.hh:186
void SetTopicName(uint64_t topic, std::string name)
Map a topic number to a string.
@ DumpMsg
print details of the request and responses
Definition: XrdClLog.hh:114
@ NoMsg
report nothing
Definition: XrdClLog.hh:109
uint64_t pMask[DumpMsg+1]
Definition: XrdClLog.hh:257
virtual void Write(const std::string &message)