|
Squid Web Cache master
|
#include <Raw.h>
Public Member Functions | |
| Raw (const char *label, const char *data, const size_t size) | |
| Raw & | minLevel (const int aLevel) |
| limit data printing to at least the given debugging level | |
| Raw & | hex () |
| print data using two hex digits per byte (decoder: xxd -r -p) | |
| Raw & | gap (bool useGap=true) |
| std::ostream & | print (std::ostream &os) const |
Public Attributes | |
| int | level |
Private Member Functions | |
| void | printHex (std::ostream &os) const |
Private Attributes | |
| const char * | label_ |
| optional data name or ID; triggers size printing | |
| const char * | data_ |
| raw data to be printed | |
| size_t | size_ |
| data length | |
| bool | useHex_ |
| whether hex() has been called | |
| bool | useGap_ |
| whether to print leading space if label is missing | |
Prints raw and/or non-terminated data safely, efficiently, and beautifully. Allows raw data debugging in debugs() statements with low debugging levels by printing only if higher section debugging levels are configured: debugs(11, DBG_IMPORTANT, "always printed" << Raw(may be printed...));
|
inline |
|
inline |
|
inline |
Definition at line 30 of file Raw.h.
References useHex_.
Referenced by Parser::BinaryTokenizer::got(), and Store::operator<<().
| std::ostream & Raw::print | ( | std::ostream & | os | ) | const |
If debugging is prohibited by the current debugs() or section level, prints nothing. Otherwise, dumps data using one of these formats: " label[size]=data" if label was set and data size is positive " label[0]" if label was set and data size is zero " data" if label was not set and data size is positive "" (i.e., prints nothing) if label was not set and data size is zero
Definition at line 17 of file Raw.cc.
References data_, DBG_DATA, label_, level, PrintHex(), Debug::SectionLevel(), size_, useGap_, and useHex_.
Referenced by operator<<().
|
private |
| int Raw::level |
Minimum section debugging level necessary for printing. By default, small strings are always printed while large strings are only printed if DBG_DATA debugging level is enabled.
Definition at line 45 of file Raw.h.
Referenced by minLevel(), and print().