libfoedus-core
FOEDUS Core Library
|
Set of options for debugging support. More...
Set of options for debugging support.
This is a POD struct. Default destructor/copy-constructor/assignment operator work fine. For ease of debugging, some of the options here has corresponding APIs to change at runtime. So, those options are merely initial configurations.
Definition at line 38 of file debugging_options.hpp.
#include <debugging_options.hpp>
Public Types | |
enum | DebugLogLevel { kDebugLogInfo = 0, kDebugLogWarning, kDebugLogError, kDebugLogFatal } |
Defines debug logging levels. More... | |
Public Member Functions | |
DebuggingOptions () | |
Constructs option values with default values. More... | |
ErrorStack | load (tinyxml2::XMLElement *element) override |
Reads the content of this object from the given XML element. More... | |
ErrorStack | save (tinyxml2::XMLElement *element) const override |
Writes the content of this object to the given XML element. More... | |
const char * | get_tag_name () const override |
Returns an XML tag name for this object as a root element. More... | |
void | assign (const foedus::externalize::Externalizable *other) override |
Polymorphic assign operator. More... | |
![]() | |
ErrorStack | load_from_string (const std::string &xml) |
Load the content of this object from the given XML string. More... | |
void | save_to_stream (std::ostream *ptr) const |
Invokes save() and directs the resulting XML text to the given stream. More... | |
ErrorStack | load_from_file (const fs::Path &path) |
Load the content of this object from the specified XML file. More... | |
ErrorStack | save_to_file (const fs::Path &path) const |
Atomically and durably writes out this object to the specified XML file. More... | |
Public Attributes | |
bool | debug_log_to_stderr_ |
Whether to write debug logs to stderr rather than log file. More... | |
DebugLogLevel | debug_log_stderr_threshold_ |
Debug logs at or above this level will be copied to stderr. More... | |
DebugLogLevel | debug_log_min_threshold_ |
Debug logs below this level will be completely ignored. More... | |
int16_t | verbose_log_level_ |
Verbose debug logs (VLOG(m)) at or less than this number will be shown. More... | |
assorted::FixedString< 252 > | verbose_modules_ |
Per-module verbose level. More... | |
fs::FixedPath | debug_log_dir_ |
Path of the folder to write debug logs. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &o, const DebuggingOptions &v) |
Additional Inherited Members | |
![]() | |
static ErrorStack | insert_comment (tinyxml2::XMLElement *element, const std::string &comment) |
static ErrorStack | append_comment (tinyxml2::XMLElement *parent, const std::string &comment) |
static ErrorStack | create_element (tinyxml2::XMLElement *parent, const std::string &name, tinyxml2::XMLElement **out) |
template<typename T > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, T value) |
Only declaration in header. More... | |
template<uint MAXLEN, typename CHAR > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const assorted::FixedString< MAXLEN, CHAR > &value) |
template<typename T > | |
static ErrorStack | add_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const std::vector< T > &value) |
vector version More... | |
template<typename ENUM > | |
static ErrorStack | add_enum_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, ENUM value) |
enum version More... | |
static ErrorStack | add_child_element (tinyxml2::XMLElement *parent, const std::string &tag, const std::string &comment, const Externalizable &child) |
child Externalizable version More... | |
template<typename T > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, T *out, bool optional=false, T value=0) |
Only declaration in header. More... | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, std::string *out, bool optional=false, const char *value="") |
string type is bit special. More... | |
template<uint MAXLEN, typename CHAR > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, assorted::FixedString< MAXLEN, CHAR > *out, bool optional=false, const assorted::FixedString< MAXLEN, CHAR > &value=assorted::FixedString< MAXLEN, CHAR >()) |
template<typename ENUM > | |
static ErrorStack | get_enum_element (tinyxml2::XMLElement *parent, const std::string &tag, ENUM *out, bool optional=false, ENUM default_value=static_cast< ENUM >(0)) |
enum version More... | |
template<typename T > | |
static ErrorStack | get_element (tinyxml2::XMLElement *parent, const std::string &tag, std::vector< T > *out, bool optional=false) |
vector version. More... | |
static ErrorStack | get_child_element (tinyxml2::XMLElement *parent, const std::string &tag, Externalizable *child, bool optional=false) |
child Externalizable version More... | |
Defines debug logging levels.
Definition at line 40 of file debugging_options.hpp.
foedus::debugging::DebuggingOptions::DebuggingOptions | ( | ) |
Constructs option values with default values.
Definition at line 22 of file debugging_options.cpp.
|
inlineoverridevirtual |
Polymorphic assign operator.
This should invoke operator= of the derived class.
[in] | other | assigned value. It must be dynamic-castable to the assignee class. |
Implements foedus::externalize::Externalizable.
Definition at line 104 of file debugging_options.hpp.
|
inlineoverridevirtual |
Returns an XML tag name for this object as a root element.
We might want to give a different name for same externalizable objects, so this is used only when it is the root element of xml.
Implements foedus::externalize::Externalizable.
Definition at line 104 of file debugging_options.hpp.
|
overridevirtual |
Reads the content of this object from the given XML element.
[in] | element | the XML element that represents this object |
Expect errors due to missing-elements, out-of-range values, etc.
Implements foedus::externalize::Externalizable.
Definition at line 31 of file debugging_options.cpp.
References debug_log_dir_, debug_log_min_threshold_, debug_log_stderr_threshold_, debug_log_to_stderr_, EXTERNALIZE_LOAD_ELEMENT, EXTERNALIZE_LOAD_ENUM_ELEMENT, foedus::kRetOk, verbose_log_level_, and verbose_modules_.
|
overridevirtual |
Writes the content of this object to the given XML element.
[in] | element | the XML element that represents this object |
Expect only out-of-memory error. We receive the XML element this object will represent, so this method does not determine the XML element name of itself. The parent object determines children's tag names because one parent object might have multiple child objects of the same type with different XML element name.
Implements foedus::externalize::Externalizable.
Definition at line 41 of file debugging_options.cpp.
References CHECK_ERROR, debug_log_dir_, debug_log_min_threshold_, debug_log_stderr_threshold_, debug_log_to_stderr_, EXTERNALIZE_SAVE_ELEMENT, EXTERNALIZE_SAVE_ENUM_ELEMENT, foedus::externalize::Externalizable::insert_comment(), foedus::kRetOk, verbose_log_level_, and verbose_modules_.
|
friend |
Definition at line 104 of file debugging_options.hpp.
fs::FixedPath foedus::debugging::DebuggingOptions::debug_log_dir_ |
Path of the folder to write debug logs.
Default is "/tmp".
Definition at line 102 of file debugging_options.hpp.
DebugLogLevel foedus::debugging::DebuggingOptions::debug_log_min_threshold_ |
Debug logs below this level will be completely ignored.
Default is kDebugLogInfo. There is an API to change this setting at runtime.
Definition at line 75 of file debugging_options.hpp.
DebugLogLevel foedus::debugging::DebuggingOptions::debug_log_stderr_threshold_ |
Debug logs at or above this level will be copied to stderr.
Default is kDebugLogInfo. There is an API to change this setting at runtime.
Definition at line 68 of file debugging_options.hpp.
bool foedus::debugging::DebuggingOptions::debug_log_to_stderr_ |
Whether to write debug logs to stderr rather than log file.
Default is false. There is an API to change this setting at runtime.
Definition at line 61 of file debugging_options.hpp.
int16_t foedus::debugging::DebuggingOptions::verbose_log_level_ |
Verbose debug logs (VLOG(m)) at or less than this number will be shown.
Default is 0. There is an API to change this setting at runtime.
Definition at line 82 of file debugging_options.hpp.
assorted::FixedString<252> foedus::debugging::DebuggingOptions::verbose_modules_ |
Per-module verbose level.
The value has to contain a comma-separated list of 'module name'='log level'. 'module name' is a glob pattern (e.g., gfs* for all modules whose name starts with "gfs"), matched against the filename base (that is, name ignoring .cc/.h./-inl.h) Default is "". There is an API to change this setting at runtime.
Definition at line 93 of file debugging_options.hpp.