bool should_log(LogLevel level) const override
Reports whether entries at this level are wanted.
void log(LogLevel level, std::string_view message, const LogContext &context) override
Writes one formatted line.
ConsoleLogger(LogLevel threshold=LogLevel::Info)
Creates a console logger.
Receives StripeKit's log entries.
virtual void log(LogLevel level, std::string_view message, const LogContext &context=LogContext{})=0
Writes one entry.
virtual ~Logger()=default
Destroys the logger instance.
virtual bool should_log(LogLevel level) const =0
Reports whether entries at this level are wanted.
A logger that discards everything.
bool should_log(LogLevel level) const override
Reports whether entries at this level are wanted.
void log(LogLevel level, std::string_view message, const LogContext &context) override
Discards the entry.
std::string redact_sensitive_value(std::string_view value)
Replaces a secret value with a placeholder.
bool is_sensitive_field_name(std::string_view field_name)
Reports whether a field is one whose value should never be logged.
LogLevel
Severity of a log entry.
std::string redact_sensitive_text(std::string_view text)
Strips secret-looking tokens out of free-form text.
@ Info
Normal, noteworthy activity.
@ Warn
Something unexpected that did not stop the operation.
@ Error
An operation failed.
@ Debug
Diagnostic detail useful while developing.
@ Trace
Very detailed tracing.
Extra identifiers attached to a log entry.
std::string request_id
Stripe request id for an outbound call, of the form "req_...".
std::string adapter_name
Name of the adapter that produced the entry.
std::optional< int > retry_attempt
Which attempt this is, for operations that are retried.
std::string event_id
Stripe event id for webhook work, of the form "evt_...".
std::string webhook_type
Stripe event type, for example "invoice.paid".