|
DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
|
Provides a modern, high-performance, and structured logging framework. More...
Classes | |
| struct | stderr_redirect |
Tag for log entries that contain content redirected from stderr. More... | |
| class | cerr_redirection |
| class | record |
| class | scope |
| Represents a logging scope. More... | |
| class | state_saver |
| RAII class to save and restore logging state (sink and filter). More... | |
| struct | audit |
| Tag for high-level, production-worthy operational events. More... | |
| struct | scope_enter |
Tag automatically added to a log entry when a log_scope is entered. More... | |
| struct | scope_exit |
Tag automatically added to a log entry when a log_scope is exited. More... | |
| struct | return_value |
Tag automatically added to a log entry created by log_return. More... | |
Functions | |
| DOCWIRE_CORE_EXPORT void | set_filter (const std::string &filter_spec) |
| DOCWIRE_CORE_EXPORT std::string | get_filter () |
| Gets the current log filter specification string. More... | |
| DOCWIRE_CORE_EXPORT void | set_sink (std::function< void(const log::record &)> callback) |
| Sets the global callback function that will receive all enabled log records. More... | |
| DOCWIRE_CORE_EXPORT std::function< void(const record &)> | get_sink () |
| Gets the current log sink function. More... | |
| DOCWIRE_CORE_EXPORT serialization::object | create_base_metadata (source_location location) |
| Creates a base serialization object with common metadata. More... | |
| template<typename... Args> | |
| void | entry (source_location location, std::tuple< Args... > &&args_tuple) |
| template<typename T , typename... Args> | |
| T && | and_forward_value (const char *expr_str, T &&value, source_location location, Args &&... args) |
| DOCWIRE_CORE_EXPORT std::function< void(const record &)> | json_stream_sink (ref_or_owned< std::ostream > stream) |
| template<typename... Args> | |
| scope (const Args &...) -> scope< Args... > | |
Provides a modern, high-performance, and structured logging framework.
The docwire::log namespace contains a powerful logging system designed for both deep debugging and zero-overhead production use. It features:
log_entry, log_scope) are completely compiled out in release builds (NDEBUG is defined), ensuring they have zero performance impact on your production code. Only logs explicitly marked with a persistent tag (like log::audit) are retained.| DOCWIRE_CORE_EXPORT serialization::object docwire::log::create_base_metadata | ( | source_location | location | ) |
Creates a base serialization object with common metadata.
| location | The source location to be included in the metadata. |
serialization::object containing timestamp, file, line, function, and thread_id. | DOCWIRE_CORE_EXPORT std::string docwire::log::get_filter | ( | ) |
Gets the current log filter specification string.
| DOCWIRE_CORE_EXPORT std::function<void(const record&)> docwire::log::get_sink | ( | ) |
Gets the current log sink function.
| DOCWIRE_CORE_EXPORT void docwire::log::set_sink | ( | std::function< void(const log::record &)> | callback | ) |
Sets the global callback function that will receive all enabled log records.
| callback | A function that takes a const serialization::object& and processes it. This is the primary mechanism for customizing the log sink. |