45#include <StormByte/safe/optional.hxx>
46#include <StormByte/safe/string.hxx>
47#include <StormByte/type_traits/safe.hxx>
Public streaming facade for the StormByte logger.
Definition log.hxx:114
STORMBYTE_DECLARE_MAYBE_SAFE(StormByte::Logger::Exception)
Logger module of the StormByte suite.
FormatManip push_format(const char *format)
Save the current format and activate a temporary format.
Definition manipulators.hxx:216
constexpr HexManip hex
Enable hex dumps with 16 bytes per row.
Definition manipulators.hxx:362
ThrottlePolicy
Count policy applied before the optional rate bucket.
Definition manipulators.hxx:63
@ Drop
Admit while the rate bucket has credit.
Definition manipulators.hxx:64
@ Sample
Admit the first and then one line of every sample period.
Definition manipulators.hxx:65
@ Window
Admit the first WindowKeep lines of every WindowPeriod.
Definition manipulators.hxx:66
constexpr RedactManip redact_first(std::size_t n) noexcept
Build a manipulator that keeps the first n characters visible.
Definition manipulators.hxx:320
constexpr RedactManip redact
Full redaction manipulator (mask everything).
Definition manipulators.hxx:313
const ColorManip color
Restore the configured color for the current level.
Definition manipulators.hxx:264
ComponentManip component(const char *name)
Select the component associated with subsequent log lines on this thread.
Definition manipulators.hxx:145
constexpr NoHexManip nohex
Disable hex dumps for subsequent payloads.
Definition manipulators.hxx:373
Log & noredact(Log &log) noexcept
Disable redaction until the next redact / redact(n) / redact_first(n).
constexpr NoColorManip nocolor
Disable color for subsequent content in the current line.
Definition manipulators.hxx:275
Log & nohumanreadable(Log &log) noexcept
Disable human-readable formatting (raw numbers).
Color
ANSI foreground colors supported by the logger.
Definition typedefs.hxx:60
constexpr ResetComponentManip reset_component
Clear the current thread's component.
Definition manipulators.hxx:180
constexpr PopFormatManip pop_format
Restore the most recently saved format, or do nothing if empty.
Definition manipulators.hxx:242
Log & humanreadable_number(Log &log) noexcept
Enable human-readable formatting for numeric values.
Log & humanreadable_bytes(Log &log) noexcept
Enable human-readable formatting for byte counts.
GroupManip group(const char *name)
Set the producer group for the current line.
Definition manipulators.hxx:102
constexpr PopComponentManip pop_component
Pop one component segment from the current thread's stack.
Definition manipulators.hxx:194
Temporarily selects a configured or explicit content color.
Definition manipulators.hxx:248
StormByte::Safe::Optional< Color > value
Explicit color, or empty for the configured level color.
Definition manipulators.hxx:249
constexpr ColorManip operator()(Color selected) const noexcept
Select an explicit color for subsequent content.
Definition manipulators.hxx:256
Selects the sticky component for the current thread.
Definition manipulators.hxx:133
StormByte::Safe::String name
Component name; empty selects the root component.
Definition manipulators.hxx:134
Labels the current logging line with a producer group.
Definition manipulators.hxx:92
StormByte::Safe::String name
Group name; an empty name clears the current group.
Definition manipulators.hxx:93
Dump subsequent payloads as hex bytes until nohex.
Definition manipulators.hxx:346
constexpr HexManip operator()(std::size_t n) const noexcept
Build a manipulator with n bytes per row.
Definition manipulators.hxx:354
std::size_t columns
Bytes per row; 0 = single line.
Definition manipulators.hxx:347
Disables color for subsequent content until changed.
Definition manipulators.hxx:270
Disable hex dumps and restore default payload formatting.
Definition manipulators.hxx:368
Pops one segment from the current thread's component stack.
Definition manipulators.hxx:188
Stateful redaction manipulator.
Definition manipulators.hxx:295
bool keep_first
true = keep first N, false = keep last N characters
Definition manipulators.hxx:297
std::size_t count
0 = mask all; N = keep N characters
Definition manipulators.hxx:296
constexpr RedactManip operator()(std::size_t n) const noexcept
Build a manipulator that keeps the last n characters visible.
Definition manipulators.hxx:304
Clears the component associated with the current thread.
Definition manipulators.hxx:174
Immutable rule description used by Log::Throttle.
Definition manipulators.hxx:76
StormByte::Safe::Optional< StormByte::Safe::String > Component
Optional component selector.
Definition manipulators.hxx:77
std::size_t SampleN
Sample period when Policy is Sample.
Definition manipulators.hxx:83
std::size_t WindowKeep
Kept lines when Policy is Window.
Definition manipulators.hxx:84
double Rate
Lines per second; zero disables refill.
Definition manipulators.hxx:80
std::size_t Burst
Initial and maximum token capacity.
Definition manipulators.hxx:81
StormByte::Safe::Optional< StormByte::Logger::Level > Level
Optional level selector.
Definition manipulators.hxx:78
std::size_t WindowPeriod
Window size when Policy is Window.
Definition manipulators.hxx:85
ThrottlePolicy Policy
Count policy.
Definition manipulators.hxx:82
StormByte::Safe::Optional< StormByte::Safe::String > Group
Optional group selector.
Definition manipulators.hxx:79
#define STORMBYTE_LOGGER_PUBLIC
Definition visibility.h:53