51 static const std::string default_name(
"global");
85 warn(
"Trying to set debug logger to NULL\n");
110 const char *
data =
static_cast<const char *
>(
d);
113 for (i = 0; i <
len; i += 16) {
114 std::ostringstream line;
120 for (j = 0; j <
c; j++) {
121 ccprintf(line,
"%02x ", data[i + j] & 0xff);
122 if ((j & 0xf) == 7 && j > 0)
130 for (j = 0; j <
c; j++) {
131 int ch = data[i +
j] & 0x7f;
132 ccprintf(line,
"%c", (
char)(isprint(ch) ? ch :
' '));
145 const std::string &message)
void ccprintf(cp::Print &print)
const std::string & name()
bool match(const std::string &name) const
virtual std::ostream & getOstream()=0
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messa...
uint64_t Tick
Tick count type.
Debug logging base class.
ObjectMatch ignore
Name match for objects to ignore.
std::ostream & output()
Get the ostream from the current global logger.
Logging wrapper for ostreams with the format: <when>: <name>: <message-body>
Logger * getDebugLogger()
Get the current global debug logger.
void logMessage(Tick when, const std::string &name, const std::string &message) override
Log formatted message.
void enable()
Enable/disable debug logging.
virtual void logMessage(Tick when, const std::string &name, const std::string &message)=0
Log formatted message.
void setDebugLogger(Logger *logger)
Delete the current global logger and assign a new one.
virtual void dump(Tick when, const std::string &name, const void *d, int len)
Dump a block of data of length len.