StormByte-Logger 3.0.0
C++26 logger module of the StormByte suite
Loading...
Searching...
No Matches
manipulators.hxx File Reference
#include <StormByte/logger/typedefs.hxx>
#include <StormByte/logger/visibility.h>
#include <StormByte/safe/optional.hxx>
#include <StormByte/safe/string.hxx>
#include <StormByte/type_traits/safe.hxx>
#include <cstddef>
#include <string_view>
Include dependency graph for manipulators.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StormByte::Logger::ThrottleSpec
 Immutable rule description used by Log::Throttle. More...
struct  StormByte::Logger::GroupManip
 Labels the current logging line with a producer group. More...
struct  StormByte::Logger::ComponentManip
 Selects the sticky component for the current thread. More...
struct  StormByte::Logger::ResetComponentManip
 Clears the component associated with the current thread. More...
struct  StormByte::Logger::PopComponentManip
 Pops one segment from the current thread's component stack. More...
struct  StormByte::Logger::FormatManip
 Temporarily replaces the logger format and saves the previous one. More...
struct  StormByte::Logger::PopFormatManip
 Restores the most recently saved logger format. More...
struct  StormByte::Logger::ColorManip
 Temporarily selects a configured or explicit content color. More...
struct  StormByte::Logger::NoColorManip
 Disables color for subsequent content until changed. More...
struct  StormByte::Logger::RedactManip
 Stateful redaction manipulator. More...
struct  StormByte::Logger::HexManip
 Dump subsequent payloads as hex bytes until nohex. More...
struct  StormByte::Logger::NoHexManip
 Disable hex dumps and restore default payload formatting. More...

Namespaces

namespace  StormByte::Logger
 Logger module of the StormByte suite.
namespace  StormByte

Enumerations

enum class  StormByte::Logger::ThrottlePolicy : unsigned char { StormByte::Logger::Drop , StormByte::Logger::Sample , StormByte::Logger::Window }
 Count policy applied before the optional rate bucket. More...

Functions

GroupManip StormByte::Logger::group (const char *name)
 Set the producer group for the current line.
GroupManip StormByte::Logger::group (std::string_view name)
 Set the producer group from a view.
GroupManip StormByte::Logger::group (const StormByte::Safe::String &name)
 Set the producer group from an owned string.
ComponentManip StormByte::Logger::component (const char *name)
 Select the component associated with subsequent log lines on this thread.
ComponentManip StormByte::Logger::component (std::string_view name)
 Select the component from a view.
ComponentManip StormByte::Logger::component (const StormByte::Safe::String &name)
 Select the component from an owned string.
FormatManip StormByte::Logger::push_format (const char *format)
 Save the current format and activate a temporary format.
FormatManip StormByte::Logger::push_format (std::string_view format)
 Save the current format and activate a temporary format from a view.
FormatManip StormByte::Logger::push_format (const StormByte::Safe::String &format)
 Save the current format and activate a temporary format from an owned string.
constexpr RedactManip StormByte::Logger::redact_first (std::size_t n) noexcept
 Build a manipulator that keeps the first n characters visible.
Log & StormByte::Logger::humanreadable_number (Log &log)
 Enable human-readable formatting for numeric values.
Log & StormByte::Logger::humanreadable_bytes (Log &log)
 Enable human-readable formatting for byte counts.
Log & StormByte::Logger::nohumanreadable (Log &log)
 Disable human-readable formatting (raw numbers).
Log & StormByte::Logger::noredact (Log &log)
 Disable redaction until the next redact / redact(n) / redact_first(n).
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::ThrottleSpec)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::GroupManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::ComponentManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::ResetComponentManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::PopComponentManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::FormatManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::PopFormatManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::ColorManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::NoColorManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::RedactManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::HexManip)
 STORMBYTE_DECLARE_MAYBE_SAFE (StormByte::Logger::NoHexManip)

Variables

constexpr ResetComponentManip StormByte::Logger::reset_component {}
 Clear the current thread's component.
constexpr PopComponentManip StormByte::Logger::pop_component {}
 Pop one component segment from the current thread's stack.
constexpr PopFormatManip StormByte::Logger::pop_format {}
 Restore the most recently saved format, or do nothing if empty.
const ColorManip StormByte::Logger::color {}
 Restore the configured color for the current level.
constexpr NoColorManip StormByte::Logger::nocolor {}
 Disable color for subsequent content in the current line.
constexpr RedactManip StormByte::Logger::redact {}
 Full redaction manipulator (mask everything).
constexpr HexManip StormByte::Logger::hex {}
 Enable hex dumps with 16 bytes per row.
constexpr NoHexManip StormByte::Logger::nohex {}
 Disable hex dumps for subsequent payloads.

Function Documentation

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [1/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::ColorManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [2/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::ComponentManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [3/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::FormatManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [4/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::GroupManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [5/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::HexManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [6/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::NoColorManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [7/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::NoHexManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [8/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::PopComponentManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [9/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::PopFormatManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [10/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::RedactManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [11/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::ResetComponentManip )

◆ STORMBYTE_DECLARE_MAYBE_SAFE() [12/12]

STORMBYTE_DECLARE_MAYBE_SAFE ( StormByte::Logger::ThrottleSpec )