|
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. More... | |
| ~Log () | |
| void | Error (uint64_t topic, const char *format,...) |
| Report an error. More... | |
| void | Warning (uint64_t topic, const char *format,...) |
| Report a warning. More... | |
| void | Info (uint64_t topic, const char *format,...) |
| Print an info. More... | |
| void | Debug (uint64_t topic, const char *format,...) |
| Print a debug message. More... | |
| void | Dump (uint64_t topic, const char *format,...) |
| Print a dump message. More... | |
| 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. More... | |
| void | SetLevel (const std::string &level) |
| Set the level of the messages that should be sent to the destination. More... | |
| void | SetOutput (LogOut *output) |
| Set the output that should be used. More... | |
| void | SetMask (LogLevel level, uint64_t mask) |
| Sets the mask for the topics of messages that should be printed. More... | |
| void | SetMask (const std::string &level, uint64_t mask) |
| Sets the mask for the topics of messages that should be printed. More... | |
| void | SetTopicName (uint64_t topic, std::string name) |
| Map a topic number to a string. More... | |
| LogLevel | GetLevel () const |
| Get the log level. More... | |
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 | |
| LogLevel | pLevel |
| uint64_t | pMask [DumpMsg+1] |
| LogOut * | pOutput |
| TopicMap | pTopicMap |
| uint32_t | pTopicMaxLength |
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.
|
inline |
Print a debug message.
References DebugMsg, likely, pLevel, pMask, Say(), and unlikely.
Referenced by XrdCl::PollerBuiltIn::AddSocket(), XrdCl::PollerLibEvent::AddSocket(), XrdCl::FileStateHandler::AfterForkChild(), XrdCl::CheckSumManager::Calculate(), XrdCl::ThirdPartyCopyJob::CanDo(), XrdCl::Channel::Channel(), XrdCl::Utils::CheckTPC(), XrdCl::ForkHandler::Child(), XrdCl::ClassicCopyJob::ClassicCopyJob(), XrdCl::AsyncSocketHandler::Close(), XrdCl::FileStateHandler::Close(), XrdCl::AsyncSocketHandler::Connect(), XrdCl::PollerFactory::CreatePoller(), XrdCl::XRootDTransport::DoAuthentication(), DoLS(), XrdCl::FSExecutor::Execute(), forkAndRead(), XrdCl::XRootDTransport::GenerateBind(), XrdCl::XRootDTransport::GenerateInitialHS(), XrdCl::XRootDTransport::GenerateInitialHSProtocol(), XrdCl::XRootDTransport::GenerateLogIn(), XrdCl::XRootDTransport::GetCredentials(), XrdCl::Env::GetInt(), XrdCl::DefaultEnv::GetMonitor(), XrdCl::Env::GetString(), RandomHandler::HandleConnection(), RandomPumpHandler::HandleConnection(), XrdClTests::Server::HandleConnections(), XrdCl::PollerLibEvent::Initialize(), XrdCl::DefaultEnv::Initialize(), XrdCl::Utils::LogHostAddresses(), MonitorTest::MonitorTest(), XrdCl::XRootDTransport::MultiplexSubStream(), XrdCl::FileStateHandler::OnClose(), XrdCl::Stream::OnConnect(), XrdCl::AsyncSocketHandler::OnConnectionReturn(), XrdCl::Stream::OnError(), XrdCl::FileStateHandler::OnOpen(), XrdCl::FileStateHandler::Open(), XrdCl::ForkHandler::Parent(), XrdCl::ForkHandler::Prepare(), XrdCl::CopyProcess::Prepare(), XrdCl::XRootDTransport::ProcessBindResp(), XrdCl::XRootDTransport::ProcessLogInResp(), XrdCl::XRootDTransport::ProcessProtocolResp(), XrdCl::XRootDTransport::ProcessServerHS(), XrdCl::Env::PutInt(), XrdCl::Env::PutString(), XrdCl::FileStateHandler::Read(), XrdCl::TaskManager::RegisterTask(), XrdCl::PollerLibEvent::RemoveSocket(), XrdCl::ClassicCopyJob::Run(), XrdCl::ThirdPartyCopyJob::Run(), runChild(), XrdCl::PollerLibEvent::RunEventLoop(), XrdCl::FileStateHandler::RunRecovery(), XrdCl::TaskManager::RunTasks(), XrdClTests::Server::Setup(), XrdCl::PollerLibEvent::Start(), XrdCl::JobManager::Start(), XrdCl::TaskManager::Start(), XrdClTests::Server::Start(), XrdCl::FileStateHandler::Stat(), XrdCl::PollerBuiltIn::Stop(), XrdCl::PollerLibEvent::Stop(), XrdCl::JobManager::Stop(), XrdCl::TaskManager::Stop(), XrdClTests::Server::Stop(), XrdCl::FileStateHandler::Sync(), XrdCl::ThirdPartyCopyJob::ThirdPartyCopyJob(), XrdCl::FileStateHandler::Truncate(), XrdCl::TaskManager::UnregisterTask(), XrdCl::FileStateHandler::VectorRead(), XrdCl::FileStateHandler::Write(), XrdClGetMonitor(), and XrdCl::Stream::~Stream().
|
inline |
Print a dump message.
References DumpMsg, likely, pLevel, pMask, Say(), and unlikely.
Referenced by XrdCl::FileSystem::AssignLoadBalancer(), XrdCl::PollerLibEvent::EnableReadNotification(), XrdCl::PollerLibEvent::EnableWriteNotification(), XrdCl::XRootDMsgHandler::Examine(), XrdCl::FSExecutor::Execute(), XrdCl::FileStateHandler::FailMessage(), XrdCl::URL::FromString(), XrdCl::CheckSumManager::GetCalculator(), XrdCl::Utils::GetLocalCheckSum(), XrdCl::Utils::GetRemoteCheckSum(), RandomHandler::HandleConnection(), RandomPumpHandler::HandleConnection(), XrdCl::PollerLibEvent::Initialize(), XrdCl::FileStateHandler::OnClose(), XrdCl::Stream::OnIncoming(), XrdCl::AsyncSocketHandler::OnRead(), XrdCl::Stream::OnReadyToWrite(), XrdCl::FileStateHandler::OnStateError(), XrdCl::FileStateHandler::OnStateResponse(), XrdCl::XRootDMsgHandler::OnStatusReady(), XrdCl::XRootDMsgHandler::OnStreamEvent(), XrdCl::AsyncSocketHandler::OnWrite(), XrdCl::XRootDMsgHandler::ParseResponse(), XrdCl::XRootDMsgHandler::Process(), XrdCl::AsyncSocketHandler::ReadMessage(), XrdCl::XRootDMsgHandler::ReadRawReadV(), XrdCl::FileStateHandler::RecoverMessage(), XrdCl::FileStateHandler::ReOpenFileAtServer(), XrdCl::FileStateHandler::ReWriteFileHandle(), XrdCl::TaskManager::RunTasks(), XrdCl::Stream::Send(), XrdCl::FileSystem::Send(), XrdCl::MessageUtils::SendMessage(), XrdCl::PollerLibEvent::Stop(), XrdCl::JobManager::StopWorkers(), XrdCl::FileStateHandler::TimeOutRequests(), XrdCl::XRootDMsgHandler::UnPackReadVResponse(), and XrdCl::AsyncSocketHandler::WriteCurrentMessage().
|
inline |
Report an error.
References ErrorMsg, pLevel, pMask, Say(), and unlikely.
Referenced by XrdCl::FSExecutor::AddCommand(), XrdCl::PollerBuiltIn::AddSocket(), XrdCl::PollerLibEvent::AddSocket(), XrdCl::CheckSumManager::Calculate(), XrdCl::ThirdPartyCopyJob::CanDo(), XrdCl::Utils::CheckTPC(), XrdCl::AsyncSocketHandler::Connect(), XrdCl::PollerFactory::CreatePoller(), XrdCl::XRootDTransport::DoAuthentication(), DoCD(), DoChMod(), DoLocate(), DoLS(), DoMkDir(), DoMv(), DoQuery(), DoRm(), DoRmDir(), DoStat(), DoStatVFS(), DoTruncate(), XrdCl::Stream::EnableLink(), XrdCl::PollerLibEvent::EnableReadNotification(), XrdCl::PollerLibEvent::EnableWriteNotification(), XrdCl::FSExecutor::Execute(), XrdCl::FileStateHandler::FailMessage(), XrdCl::URL::FromString(), XrdCl::XRootDTransport::GetAuthHandler(), XrdCl::CheckSumManager::GetCalculator(), XrdCl::PostMaster::GetChannel(), XrdCl::XRootDTransport::GetCredentials(), XrdCl::Utils::GetLocalCheckSum(), XrdCl::DefaultEnv::GetMonitor(), RandomHandler::HandleConnection(), RandomPumpHandler::HandleConnection(), XrdClTests::Server::HandleConnections(), XrdCl::XRootDMsgHandler::HandleError(), XRootDProtocolHelper::HandleLogin(), XrdCl::XRootDTransport::HandShake(), XrdCl::Env::ImportInt(), XrdCl::PollerLibEvent::Initialize(), XrdCl::DefaultEnv::Initialize(), XrdCl::XRootDTransport::LogErrorResponse(), XrdCl::AsyncSocketHandler::OnConnectionReturn(), XrdCl::Stream::OnFatalError(), XrdCl::AsyncSocketHandler::OnFault(), XrdCl::AsyncSocketHandler::OnFaultWhileHandshaking(), XrdCl::FileStateHandler::OnStateError(), XrdCl::XRootDMsgHandler::OnStatusReady(), XrdCl::FileStateHandler::Open(), XrdCl::XRootDMsgHandler::ParseResponse(), XrdCl::XRootDMsgHandler::Process(), XrdCl::XRootDTransport::ProcessBindResp(), XrdCl::XRootDTransport::ProcessLogInResp(), XrdCl::XRootDTransport::ProcessProtocolResp(), XrdCl::XRootDTransport::ProcessServerHS(), XrdCl::XRootDMsgHandler::ReadRawRead(), XrdCl::XRootDMsgHandler::ReadRawReadV(), XrdCl::PollerLibEvent::RemoveSocket(), XrdCl::XRootDMsgHandler::RewriteRequestRedirect(), XrdCl::ThirdPartyCopyJob::Run(), XrdCl::PollerLibEvent::RunEventLoop(), XrdCl::MessageUtils::SendMessage(), XrdClTests::Server::Setup(), XrdCl::PollerLibEvent::Start(), XrdCl::JobManager::Start(), XrdCl::TaskManager::Start(), XrdClTests::Server::Start(), XrdCl::PollerLibEvent::Stop(), XrdCl::JobManager::Stop(), XrdCl::TaskManager::Stop(), XrdClTests::Server::Stop(), XrdCl::XRootDTransport::StreamAction(), and XrdCl::XRootDMsgHandler::UnPackReadVResponse().
|
inline |
|
inline |
Print an info.
References InfoMsg, likely, pLevel, pMask, Say(), and unlikely.
Referenced by DoLS(), XrdCl::Env::ImportInt(), XrdCl::Env::ImportString(), and XrdCl::Stream::OnConnectError().
|
private |
| void XrdCl::Log::Say | ( | LogLevel | level, |
| uint64_t | topic, | ||
| const char * | format, | ||
| va_list | list | ||
| ) |
Always print the message
| level | log level |
| type | topic of the message |
| format | format string - the same as in printf |
| list | list of arguments |
References XrdOucTokenizer::GetLine(), LogLevelToString(), pOutput, TopicToString(), and XrdCl::LogOut::Write().
Referenced by Debug(), Dump(), Error(), Info(), and Warning().
|
inline |
Set the level of the messages that should be sent to the destination.
References pLevel.
Referenced by XrdCl::DefaultEnv::SetUpLog().
|
inline |
Set the level of the messages that should be sent to the destination.
References pLevel, and StringToLogLevel().
|
inline |
Sets the mask for the topics of messages that should be printed.
References pMask.
Referenced by XrdCl::DefaultEnv::SetUpLog().
|
inline |
Sets the mask for the topics of messages that should be printed.
References pMask, and StringToLogLevel().
|
inline |
Set the output that should be used.
References pOutput.
Referenced by XrdCl::DefaultEnv::SetUpLog().
| void XrdCl::Log::SetTopicName | ( | uint64_t | topic, |
| std::string | name | ||
| ) |
Map a topic number to a string.
References pTopicMap, and pTopicMaxLength.
Referenced by XrdCl::DefaultEnv::SetUpLog().
|
private |
References DebugMsg, DumpMsg, ErrorMsg, InfoMsg, and WarningMsg.
Referenced by SetLevel(), and SetMask().
|
private |
References pTopicMap, and pTopicMaxLength.
Referenced by Say().
|
inline |
Report a warning.
References pLevel, pMask, Say(), unlikely, and WarningMsg.
Referenced by XrdCl::PollerBuiltIn::AddSocket(), XrdCl::PollerLibEvent::AddSocket(), XrdCl::PollerLibEvent::EnableReadNotification(), XrdCl::PollerLibEvent::EnableWriteNotification(), and XrdCl::Stream::Send().
|
private |
Referenced by Debug(), Dump(), Error(), GetLevel(), Info(), SetLevel(), and Warning().
|
private |
|
private |
Referenced by Log(), Say(), SetOutput(), and ~Log().
|
private |
Referenced by SetTopicName(), and TopicToString().
|
private |
Referenced by SetTopicName(), and TopicToString().
1.8.3.1