|
libbgp
0.6
A C++ BGP Library.
|
The BgpLogHandler class. More...
#include <bgp-log-handler.h>
Public Member Functions | |
| void | log (LogLevel level, const char *format_str,...) |
| Log a message. Consider using LIBBGP_LOG if logging the message needs a lot of computing power. (e.g., print Serializable or converting IP to string.) More... | |
| void | log (LogLevel level, const Serializable &serializable) |
| Log a message. Consider using LIBBGP_LOG if logging the message needs a lot of computing power. (e.g., print Serializable or converting IP to string.) More... | |
| void | setLogLevel (LogLevel level) |
| Set the log level. More... | |
| LogLevel | getLogLevel () const |
| Get the log level. More... | |
| virtual | ~BgpLogHandler () |
| Destroy the Bgp Log Handler object. | |
Protected Member Functions | |
| virtual void | logImpl (const char *str) |
| Log implementation. By default, it writes to stderr. You may implement your own BgpLogHandler to write message to a different place. More... | |
The BgpLogHandler class.
The log handler class is used by various other classes to print message.
Definition at line 47 of file bgp-log-handler.h.
| LogLevel libbgp::BgpLogHandler::getLogLevel | ( | ) | const |
| void libbgp::BgpLogHandler::log | ( | LogLevel | level, |
| const char * | format_str, | ||
| ... | |||
| ) |
Log a message. Consider using LIBBGP_LOG if logging the message needs a lot of computing power. (e.g., print Serializable or converting IP to string.)
| level | Log level. |
| format_str | printf format string. |
| ... | printf variables. |
Definition at line 56 of file bgp-log-handler.cc.
References logImpl().
Referenced by libbgp::BgpPathAttrib::BgpPathAttrib(), libbgp::BgpPathAttrib::clone(), libbgp::BgpPathAttribOrigin::clone(), libbgp::BgpPathAttribAsPath::clone(), libbgp::BgpPathAttribNexthop::clone(), libbgp::BgpPathAttribMed::clone(), libbgp::BgpPathAttribLocalPref::clone(), libbgp::BgpPathAttribAtomicAggregate::clone(), libbgp::BgpPathAttribAggregator::clone(), libbgp::BgpPathAttribAs4Path::clone(), libbgp::BgpPathAttribAs4Aggregator::clone(), libbgp::BgpPathAttribCommunity::clone(), libbgp::BgpPathAttribMpReachNlriIpv6::clone(), libbgp::BgpPathAttribMpReachNlriUnknow::clone(), libbgp::BgpPathAttribMpUnreachNlriIpv6::clone(), libbgp::BgpPathAttribMpUnreachNlriUnknow::clone(), libbgp::BgpSink::fill(), libbgp::Serializable::length(), libbgp::BgpPathAttribCommunity::length(), libbgp::BgpBadMessage::parse(), libbgp::BgpPacket::parse(), libbgp::BgpPathAttribMpReachNlriUnknow::parse(), libbgp::BgpSink::pour(), libbgp::Serializable::setError(), libbgp::BgpBadMessage::write(), libbgp::BgpPacket::write(), libbgp::BgpOpenMessage::write(), libbgp::BgpCapability4BytesAsn::write(), libbgp::BgpUpdateMessage::write(), libbgp::BgpPathAttrib::write(), libbgp::BgpCapabilityMpBgp::write(), libbgp::BgpCapabilityUnknow::write(), libbgp::BgpPathAttribOrigin::write(), libbgp::BgpPathAttribAsPath::write(), libbgp::BgpPathAttribNexthop::write(), libbgp::BgpPathAttribMed::write(), libbgp::BgpPathAttribLocalPref::write(), libbgp::BgpPathAttribAtomicAggregate::write(), libbgp::BgpPathAttribAggregator::write(), libbgp::BgpPathAttribAs4Path::write(), libbgp::BgpPathAttribAs4Aggregator::write(), libbgp::BgpPathAttribCommunity::write(), libbgp::BgpPathAttribMpReachNlriIpv6::write(), libbgp::BgpPathAttribMpReachNlriUnknow::write(), libbgp::BgpPathAttribMpUnreachNlriIpv6::write(), libbgp::BgpPathAttribMpUnreachNlriUnknow::write(), and libbgp::BgpPathAttrib::writeHeader().
| void libbgp::BgpLogHandler::log | ( | LogLevel | level, |
| const Serializable & | serializable | ||
| ) |
Log a message. Consider using LIBBGP_LOG if logging the message needs a lot of computing power. (e.g., print Serializable or converting IP to string.)
| level | Log level. |
| serializable | Serializable object to log. |
Definition at line 78 of file bgp-log-handler.cc.
References logImpl(), and libbgp::Serializable::print().
|
protectedvirtual |
Log implementation. By default, it writes to stderr. You may implement your own BgpLogHandler to write message to a different place.
| str | Log message. |
Definition at line 86 of file bgp-log-handler.cc.
Referenced by log(), and ~BgpLogHandler().
| void libbgp::BgpLogHandler::setLogLevel | ( | LogLevel | level | ) |
Set the log level.
| level | Log level. |
Definition at line 34 of file bgp-log-handler.cc.
1.8.13