|
StripeKit 0.1.1
Stripe integration toolkit for C++
|
Receives StripeKit's log entries. More...
#include <Logging.h>
Public Member Functions | |
| virtual | ~Logger ()=default |
| Destroys the logger instance. | |
| virtual bool | should_log (LogLevel level) const =0 |
| Reports whether entries at this level are wanted. | |
| virtual void | log (LogLevel level, std::string_view message, const LogContext &context=LogContext{})=0 |
| Writes one entry. | |
Receives StripeKit's log entries.
Implement this to route StripeKit's diagnostics into the application's own log. Adapters usually provide one already, such as stripekit::drogon::LogBridge.
Entries may be written from any thread, so implementations must be thread-safe. They must not throw, and must never write the API key or the webhook signing secret; redact_sensitive_text() helps with the latter.
|
virtualdefault |
Destroys the logger instance.
|
pure virtual |
Reports whether entries at this level are wanted.
StripeKit checks this before building a message, so answering honestly avoids formatting work for entries that would be thrown away.
| level | Severity being considered. |
Implemented in stripekit::ConsoleLogger, stripekit::drogon::LogBridge, and stripekit::NullLogger.
|
pure virtual |
Writes one entry.
| level | Severity of the entry. |
| message | The text to record. |
| context | Identifiers to attach. Fields that do not apply are empty. |
Implemented in stripekit::ConsoleLogger, stripekit::drogon::LogBridge, and stripekit::NullLogger.