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 );
93 virtual void Write(
const std::string &message );
125 for(
int i = 0; i < maxMask; ++i )
126 pMask[i] = 0xffffffffffffffffULL;
140 void Error( uint64_t topic,
const char *format, ... );
145 void Warning( uint64_t topic,
const char *format, ... );
150 void Info( uint64_t topic,
const char *format, ... );
155 void Debug( uint64_t topic,
const char *format, ... );
160 void Dump( uint64_t topic,
const char *format, ... );
170 void Say(
LogLevel level, uint64_t topic,
const char *format, va_list list );
177 #if __cplusplus >= 201103L
178 pLevel.store(level, std::memory_order_relaxed);
214 void SetMask(
const std::string &level, uint64_t mask )
232 uint64_t tpcnb =
pTopicMap.rbegin()->first << 1;
242 #if __cplusplus >= 201103L
264 #if __cplusplus >= 201103L
265 std::atomic<LogLevel>
pLevel;
277 #endif // __XRD_CL_LOG_HH__
LogLevel pLevel
Definition: XrdClLog.hh:267
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
Write log messages to a file.
Definition: XrdClLog.hh:67
Definition: XrdSysPthread.hh:166
void Close()
Close the log file.
virtual ~LogOutCerr()
Definition: XrdClLog.hh:94
void SetMask(LogLevel level, uint64_t mask)
Sets the mask for the topics of messages that should be printed.
Definition: XrdClLog.hh:206
bool Open(const std::string &fileName)
Open the log file.
bool StringToLogLevel(const std::string &strLevel, LogLevel &level)
Handle diagnostics.
Definition: XrdClLog.hh:103
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:253
uint32_t pTopicMaxLength
Definition: XrdClLog.hh:272
XrdSysMutex pMutex
Definition: XrdClLog.hh:96
@ WarningMsg
report warnings
Definition: XrdClLog.hh:112
TopicMap pTopicMap
Definition: XrdClLog.hh:271
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:259
void Error(uint64_t topic, const char *format,...)
Report an error.
~Log()
Definition: XrdClLog.hh:132
LogLevel GetLevel() const
Get the log level.
Definition: XrdClLog.hh:240
virtual void Write(const std::string &message)
LogOut * pOutput
Definition: XrdClLog.hh:270
void SetLevel(LogLevel level)
Set the level of the messages that should be sent to the destination.
Definition: XrdClLog.hh:175
@ InfoMsg
print info
Definition: XrdClLog.hh:113
LogLevel
Log levels.
Definition: XrdClLog.hh:109
void SetMask(const std::string &level, uint64_t mask)
Sets the mask for the topics of messages that should be printed.
Definition: XrdClLog.hh:214
pid_t pPid
Definition: XrdClLog.hh:273
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:91
@ DebugMsg
print debug info
Definition: XrdClLog.hh:114
Definition: XrdClAnyObject.hh:26
Interface for logger outputs.
Definition: XrdClLog.hh:51
@ ErrorMsg
report errors
Definition: XrdClLog.hh:111
int pFileDes
Definition: XrdClLog.hh:84
void SetOutput(LogOut *output)
Set the output that should be used.
Definition: XrdClLog.hh:197
Log()
Constructor.
Definition: XrdClLog.hh:121
void SetLevel(const std::string &level)
Set the level of the messages that should be sent to the destination.
Definition: XrdClLog.hh:187
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:115
uint64_t RegisterTopic(const std::string &topic)
Register new topic.
Definition: XrdClLog.hh:230
@ NoMsg
report nothing
Definition: XrdClLog.hh:110
uint64_t pMask[DumpMsg+1]
Definition: XrdClLog.hh:269
virtual void Write(const std::string &message)