xrootd
|
Handle diagnostics. More...
#include <XrdClLog.hh>
Public Types | |
enum | LogLevel { NoMsg = 0 , ErrorMsg = 1 , WarningMsg = 2 , InfoMsg = 3 , DebugMsg = 4 , DumpMsg = 5 } |
Log levels. More... | |
Public Member Functions | |
Log () | |
Constructor. | |
~Log () | |
void | Error (uint64_t topic, const char *format,...) |
Report an error. | |
void | Warning (uint64_t topic, const char *format,...) |
Report a warning. | |
void | Info (uint64_t topic, const char *format,...) |
Print an info. | |
void | Debug (uint64_t topic, const char *format,...) |
Print a debug message. | |
void | Dump (uint64_t topic, const char *format,...) |
Print a dump message. | |
void | Say (LogLevel level, uint64_t topic, const char *format, va_list list) |
void | SetLevel (LogLevel level) |
Set the level of the messages that should be sent to the destination. | |
void | SetLevel (const std::string &level) |
Set the level of the messages that should be sent to the destination. | |
void | SetOutput (LogOut *output) |
Set the output that should be used. | |
void | SetMask (LogLevel level, uint64_t mask) |
Sets the mask for the topics of messages that should be printed. | |
void | SetMask (const std::string &level, uint64_t mask) |
Sets the mask for the topics of messages that should be printed. | |
void | SetTopicName (uint64_t topic, std::string name) |
Map a topic number to a string. | |
uint64_t | RegisterTopic (const std::string &topic) |
Register new topic. | |
LogLevel | GetLevel () const |
Get the log level. | |
void | SetPid (pid_t pid) |
Set pid. | |
Private Types | |
typedef std::map< uint64_t, std::string > | TopicMap |
Private Member Functions | |
std::string | LogLevelToString (LogLevel level) |
bool | StringToLogLevel (const std::string &strLevel, LogLevel &level) |
std::string | TopicToString (uint64_t topic) |
Private Attributes | |
std::atomic< LogLevel > | pLevel |
uint64_t | pMask [DumpMsg+1] |
LogOut * | pOutput |
TopicMap | pTopicMap |
uint32_t | pTopicMaxLength |
pid_t | pPid |
Handle diagnostics.
|
private |
enum XrdCl::Log::LogLevel |
Log levels.
Enumerator | |
---|---|
NoMsg | report nothing |
ErrorMsg | report errors |
WarningMsg | report warnings |
InfoMsg | print info |
DebugMsg | print debug info |
DumpMsg | print details of the request and responses |
|
inline |
References pOutput.
void XrdCl::Log::Debug | ( | uint64_t | topic, |
const char * | format, | ||
... | |||
) |
Print a debug message.
Referenced by XrdCl::XRootDMsgHandler::XRootDMsgHandler(), and XrdCl::XRootDMsgHandler::~XRootDMsgHandler().
void XrdCl::Log::Dump | ( | uint64_t | topic, |
const char * | format, | ||
... | |||
) |
Print a dump message.
Referenced by XrdCl::CheckSumHelper::GetCheckSum(), XrdCl::AsyncHSReader::Read(), XrdCl::AsyncMsgReader::Read(), XrdCl::AsyncVectorReader::Read(), and XrdCl::AsyncMsgWriter::Write().
void XrdCl::Log::Error | ( | uint64_t | topic, |
const char * | format, | ||
... | |||
) |
Report an error.
Referenced by XrdCl::RecorderFactory::CreateFileSystem(), XrdCl::CheckSumHelper::GetCheckSumImpl(), XrdCl::CheckSumHelper::Initialize(), XrdCl::Recorder::Output::Instance(), XrdCl::AsyncDiscardReader::Read(), XrdCl::AsyncRawReader::Read(), XrdCl::AsyncVectorReader::Read(), XrdCl::AsyncHSWriter::Write(), and XrdCl::AsyncMsgWriter::Write().
void XrdCl::Log::Info | ( | uint64_t | topic, |
const char * | format, | ||
... | |||
) |
Print an info.
|
private |
|
inline |
Register new topic.
References pTopicMap, and SetTopicName().
void XrdCl::Log::Say | ( | LogLevel | level, |
uint64_t | topic, | ||
const char * | format, | ||
va_list | list | ||
) |
Always print the message
level | log level |
topic | topic of the message |
format | format string - the same as in printf |
list | list of arguments |
|
inline |
Set the level of the messages that should be sent to the destination.
References SetLevel(), and StringToLogLevel().
|
inline |
Set the level of the messages that should be sent to the destination.
References pLevel.
Referenced by SetLevel().
|
inline |
Sets the mask for the topics of messages that should be printed.
References pMask, and StringToLogLevel().
|
inline |
Sets the mask for the topics of messages that should be printed.
References pMask.
|
inline |
Set the output that should be used.
References pOutput.
|
inline |
Set pid.
References pPid.
void XrdCl::Log::SetTopicName | ( | uint64_t | topic, |
std::string | name | ||
) |
Map a topic number to a string.
Referenced by RegisterTopic().
|
private |
Referenced by SetLevel(), and SetMask().
|
private |
void XrdCl::Log::Warning | ( | uint64_t | topic, |
const char * | format, | ||
... | |||
) |
Report a warning.
Referenced by XrdCl::Recorder::Output::Open(), XrdCl::Recorder::Output::Write(), and XrdCl::Recorder::Output::~Output().
|
private |
Referenced by GetLevel(), and SetLevel().
|
private |
Referenced by Log(), SetOutput(), and ~Log().
|
private |
Referenced by SetPid().
|
private |
Referenced by RegisterTopic().
|
private |