StormByte C++ Library: Logger module 1.2.0
StormByte-Logger is the logging module of the StormByte C++ suite.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
StormByte::Logger::ThreadedLog Class Reference

Thread-safe logging facade. More...

#include <StormByte/logger/threaded_log.hxx>

Inheritance diagram for StormByte::Logger::ThreadedLog:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Logger::ThreadedLog:
Collaboration graph
[legend]

Public Member Functions

 ThreadedLog (std::ostream &out, const Level &level=Level::Info, const std::string &format="[%L] %T")
 Construct a ThreadedLog writing to out.
 
 ThreadedLog (const ThreadedLog &)=default
 Copy constructor.
 
 ThreadedLog (ThreadedLog &&) noexcept=default
 Move constructor.
 
 ~ThreadedLog () noexcept override=default
 Destructor.
 
ThreadedLogoperator= (const ThreadedLog &)=default
 Copy assignment.
 
ThreadedLogoperator= (ThreadedLog &&) noexcept=default
 Move assignment.
 
LogColor (const Level &level, const StormByte::Logger::Color &color) override
 Set a level color while holding the line lock.
 
StormByte::Logger::Color Color (const Level &level) const override
 Get the configured color for a logging level.
 
LogColor (const std::string &component, const Level &level, const StormByte::Logger::Color &color) override
 Set a component color override under the line lock.
 
StormByte::Logger::Color Color (const std::string &component, const Level &level) const override
 Get a component color, falling back along the path then to the general color.
 
LogFormat (const std::string &format) override
 Set the header format under the line lock.
 
const std::string & Format () const override
 Get the effective current header format.
 
LogFormat (const std::string &component, const std::string &format) override
 Set or remove a component-specific header format under the line lock.
 
const std::string & Format (const std::string &component) const override
 Get a component-specific format, falling back along the path then to general.
 
LogThrottle (const ThrottleSpec &spec) override
 Install a throttle rule under the line lock.
 
LogNoThrottle (const ThrottleSpec &spec) override
 Remove a throttle rule under the line lock.
 
LogThrottle (double rate, std::size_t burst) override
 Install a Drop rule (global, or sticky path if scoped).
 
LogThrottle (double rate, std::size_t burst, ThrottlePolicy policy, std::size_t value, std::size_t period=0) override
 Install a Sample or Window rule (global, or sticky path if scoped).
 
LogThrottle (const Level &level, double rate, std::size_t burst) override
 Install a level-scoped Drop rule.
 
LogThrottle (GroupManip group, double rate, std::size_t burst) override
 Install a group-scoped Drop rule.
 
LogThrottle (ComponentManip component, double rate, std::size_t burst) override
 Install a component-scoped Drop rule.
 
LogThrottle (ComponentManip component, const Level &level, GroupManip group, double rate, std::size_t burst, ThrottlePolicy policy=ThrottlePolicy::Drop, std::size_t value=0, std::size_t period=0) override
 Install an exact component/level/group rule.
 
LogNoThrottle () override
 Remove all throttle rules.
 
LogNoThrottle (const Level &level) override
 Remove a level-scoped rule.
 
LogNoThrottle (GroupManip group) override
 Remove a group-scoped rule.
 
LogNoThrottle (ComponentManip component) override
 Remove a component-scoped rule.
 
LogNoThrottle (ComponentManip component, const Level &level, GroupManip group) override
 Remove an exact component/level/group rule.
 
LogFlushThrottle () override
 Flush all dropped summaries under the line lock.
 
LogFlushThrottle (const ThrottleSpec &spec) override
 Flush matching dropped summaries under the line lock.
 
- Public Member Functions inherited from StormByte::Logger::Log
 Log (std::ostream &out, const Level &level=Level::Info, const std::string &format="[%L] %T")
 Construct a Log writing to out.
 
 Log (const Log &)=default
 Copy constructor.
 
 Log (Log &&) noexcept=default
 Move constructor.
 
 ~Log () noexcept override=default
 Destructor.
 
Logoperator= (const Log &)=default
 Copy assignment.
 
Logoperator= (Log &&) noexcept=default
 Move assignment.
 
PointerType Scope (std::string path)
 Another facade on the same backend, with a sticky component path.
 
bool Enabled (const Level &level) const noexcept
 Whether level would be emitted given the print floor.
 
Logoperator<< (bool v)
 
Logoperator<< (char v)
 
Logoperator<< (signed char v)
 
Logoperator<< (unsigned char v)
 
Logoperator<< (short v)
 
Logoperator<< (unsigned short v)
 
Logoperator<< (int v)
 
Logoperator<< (unsigned int v)
 
Logoperator<< (long v)
 
Logoperator<< (unsigned long v)
 
Logoperator<< (long long v)
 
Logoperator<< (unsigned long long v)
 
Logoperator<< (float v)
 
Logoperator<< (double v)
 
Logoperator<< (long double v)
 
Logoperator<< (std::string_view v)
 Stream UTF-8 text.
 
Logoperator<< (const char *v)
 
Logoperator<< (std::wstring_view v)
 Stream wide text.
 
Logoperator<< (const wchar_t *v)
 
Logoperator<< (std::span< const std::byte > v)
 Stream raw bytes.
 
Logoperator<< (const Level &level)
 
Logoperator<< (std::ostream &(*manip)(std::ostream &))
 
Logoperator<< (Log &(*manip)(Log &) noexcept)
 
Logoperator<< (RedactManip m)
 Apply redaction policy (full or keep-last-N).
 
Logoperator<< (HexManip m)
 Dump subsequent payloads as hex bytes until nohex.
 
Logoperator<< (NoHexManip m)
 Disable hex dumps and restore default payload formatting.
 
Logoperator<< (ColorManip manip)
 Apply a configured or explicit content color.
 
Logoperator<< (NoColorManip manip)
 Disable color for subsequent content.
 
Logoperator<< (FormatManip manip)
 Save the current format and activate a temporary format.
 
Logoperator<< (PopFormatManip manip)
 Restore the most recently saved format.
 
Logoperator<< (GroupManip manip)
 Set the producer group for the current line.
 
Logoperator<< (ComponentManip manip)
 Push a component segment onto the current thread's stack.
 
Logoperator<< (PopComponentManip manip)
 Pop one component segment from the current thread's stack.
 
Logoperator<< (ResetComponentManip manip)
 Clear the current thread's component stack.
 

Streaming Operators

Same contract as Log; data overloads early-out when filtered.

Logoperator<< (bool v)
 
Logoperator<< (char v)
 
Logoperator<< (signed char v)
 
Logoperator<< (unsigned char v)
 
Logoperator<< (short v)
 
Logoperator<< (unsigned short v)
 
Logoperator<< (int v)
 
Logoperator<< (unsigned int v)
 
Logoperator<< (long v)
 
Logoperator<< (unsigned long v)
 
Logoperator<< (long long v)
 
Logoperator<< (unsigned long long v)
 
Logoperator<< (float v)
 
Logoperator<< (double v)
 
Logoperator<< (long double v)
 
Logoperator<< (std::string_view v)
 Stream UTF-8 text.
 
Logoperator<< (const char *v)
 
Logoperator<< (std::wstring_view v)
 Stream wide text.
 
Logoperator<< (const wchar_t *v)
 
Logoperator<< (std::span< const std::byte > v)
 Stream raw bytes.
 
Logoperator<< (const Level &level)
 
Logoperator<< (std::ostream &(*manip)(std::ostream &))
 
Logoperator<< (Log &(*manip)(Log &) noexcept)
 
Logoperator<< (RedactManip m)
 Apply redaction policy.
 
Logoperator<< (HexManip m)
 Dump subsequent payloads as hex bytes until nohex.
 
Logoperator<< (NoHexManip m)
 Disable hex dumps and restore default payload formatting.
 
Logoperator<< (ColorManip manip)
 Apply a configured or explicit content color.
 
Logoperator<< (NoColorManip manip)
 Disable color for subsequent content.
 
Logoperator<< (FormatManip manip)
 Save and activate a temporary format under the line lock.
 
Logoperator<< (PopFormatManip manip)
 Restore a saved format under the line lock.
 
Logoperator<< (GroupManip manip)
 Set the producer group for the current line under the line lock.
 
Logoperator<< (ComponentManip manip)
 Push a component segment onto the current thread's stack.
 
Logoperator<< (PopComponentManip manip)
 Pop one component segment from the current thread's stack.
 
Logoperator<< (ResetComponentManip manip)
 Clear the current thread's component stack.
 
PointerType Clone () const override
 Deep-copy this facade into a shared_ptr.
 
PointerType Move () override
 Move this facade into a shared_ptr.
 

Additional Inherited Members

- Public Types inherited from StormByte::Logger::Log
using PointerType = StormByte::Clonable< Log, std::shared_ptr< Log > >::PointerType
 Smart pointer returned by Clone, Move and Scope.
 
- Protected Member Functions inherited from StormByte::Logger::Log
bool WillWrite () const noexcept
 Whether the current line level will be written.
 
bool PrepareLine ()
 Decide throttle admission before a payload claims a line lock.
 
bool HasOpenOutputLine () const noexcept
 Whether output has already started for the current line.
 
bool LineDecided () const noexcept
 Whether throttle has already decided the current line.
 
bool LineAdmitted () const noexcept
 Whether the decided current line is admitted.
 
PointerType Clone () const override
 Deep-copy this facade into a shared_ptr.
 
PointerType Move () override
 Move this facade into a shared_ptr.
 
- Protected Attributes inherited from StormByte::Logger::Log
std::shared_ptr< Implementation > m_impl
 Shared backend (copies of Log share it)
 
std::string m_scope_path
 Sticky component path; empty = root facade.
 

Detailed Description

Thread-safe logging facade.

Serializes logical lines (until a newline manipulator) so concurrent writers do not interleave. Filtered messages do not hold the line lock. Text payloads use std::string_view / std::wstring_view like Log. Binary payloads use std::span<const std::byte> (Base64 by default).

Scope clones this type and shares both the Implementation and the line lock. The sticky component path is copied onto the clone.

Constructor & Destructor Documentation

◆ ThreadedLog() [1/3]

StormByte::Logger::ThreadedLog::ThreadedLog ( std::ostream &  out,
const Level level = Level::Info,
const std::string &  format = "[%L] %T" 
)

Construct a ThreadedLog writing to out.

Parameters
outOutput stream.
levelMinimum Level that will be emitted.
formatHeader format string (L, T, i, c, g).

◆ ThreadedLog() [2/3]

StormByte::Logger::ThreadedLog::ThreadedLog ( const ThreadedLog )
default

Copy constructor.

Note
Shares the Implementation and the line lock. Copies the sticky path.

◆ ThreadedLog() [3/3]

StormByte::Logger::ThreadedLog::ThreadedLog ( ThreadedLog &&  )
defaultnoexcept

Move constructor.

◆ ~ThreadedLog()

StormByte::Logger::ThreadedLog::~ThreadedLog ( )
overridedefaultnoexcept

Destructor.

Member Function Documentation

◆ Clone()

PointerType StormByte::Logger::ThreadedLog::Clone ( ) const
overrideprotected

Deep-copy this facade into a shared_ptr.

Returns
Pointer to a ThreadedLog that shares Implementation and line lock.

◆ Color() [1/4]

StormByte::Logger::Color StormByte::Logger::ThreadedLog::Color ( const Level level) const
overridevirtual

Get the configured color for a logging level.

Parameters
levelLevel whose color is requested.
Returns
Configured color.

Reimplemented from StormByte::Logger::Log.

◆ Color() [2/4]

Log & StormByte::Logger::ThreadedLog::Color ( const Level level,
const StormByte::Logger::Color color 
)
overridevirtual

Set a level color while holding the line lock.

Parameters
levelLevel whose color is changed.
colorColor to use for that level.
Returns
Reference to this logger.
Note
On a scoped facade this stores a component override for the sticky path.

Reimplemented from StormByte::Logger::Log.

◆ Color() [3/4]

StormByte::Logger::Color StormByte::Logger::ThreadedLog::Color ( const std::string &  component,
const Level level 
) const
overridevirtual

Get a component color, falling back along the path then to the general color.

Parameters
componentComponent path.
levelLevel whose color is requested.
Returns
Component override or general color.

Reimplemented from StormByte::Logger::Log.

◆ Color() [4/4]

Log & StormByte::Logger::ThreadedLog::Color ( const std::string &  component,
const Level level,
const StormByte::Logger::Color color 
)
overridevirtual

Set a component color override under the line lock.

Parameters
componentComponent path.
levelLevel whose color is changed.
colorColor to use for that component and level.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ FlushThrottle() [1/2]

Log & StormByte::Logger::ThreadedLog::FlushThrottle ( )
overridevirtual

Flush all dropped summaries under the line lock.

Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ FlushThrottle() [2/2]

Log & StormByte::Logger::ThreadedLog::FlushThrottle ( const ThrottleSpec spec)
overridevirtual

Flush matching dropped summaries under the line lock.

Parameters
specSelectors of the rules to flush.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Format() [1/4]

const std::string & StormByte::Logger::ThreadedLog::Format ( ) const
overridevirtual

Get the effective current header format.

Returns
Temporary, component-specific or general format.

Reimplemented from StormByte::Logger::Log.

◆ Format() [2/4]

const std::string & StormByte::Logger::ThreadedLog::Format ( const std::string &  component) const
overridevirtual

Get a component-specific format, falling back along the path then to general.

Parameters
componentComponent path.
Returns
Component format or general format.

Reimplemented from StormByte::Logger::Log.

◆ Format() [3/4]

Log & StormByte::Logger::ThreadedLog::Format ( const std::string &  component,
const std::string &  format 
)
overridevirtual

Set or remove a component-specific header format under the line lock.

Parameters
componentComponent path.
formatFormat, or empty to remove the override.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Format() [4/4]

Log & StormByte::Logger::ThreadedLog::Format ( const std::string &  format)
overridevirtual

Set the header format under the line lock.

Parameters
formatFormat used by default, or for the sticky path on a scoped facade.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Move()

PointerType StormByte::Logger::ThreadedLog::Move ( )
overrideprotected

Move this facade into a shared_ptr.

Returns
Pointer to a ThreadedLog that shares Implementation and line lock.
Note
This object is not emptied; the Implementation stays shared.

◆ NoThrottle() [1/6]

Log & StormByte::Logger::ThreadedLog::NoThrottle ( )
overridevirtual

Remove all throttle rules.

Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ NoThrottle() [2/6]

Log & StormByte::Logger::ThreadedLog::NoThrottle ( ComponentManip  component)
overridevirtual

Remove a component-scoped rule.

The manipulator path is used as-is.

Parameters
componentComponent path.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ NoThrottle() [3/6]

Log & StormByte::Logger::ThreadedLog::NoThrottle ( ComponentManip  component,
const Level level,
GroupManip  group 
)
overridevirtual

Remove an exact component/level/group rule.

Parameters
componentComponent path used as-is.
levelLevel selector.
groupGroup selector.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ NoThrottle() [4/6]

Log & StormByte::Logger::ThreadedLog::NoThrottle ( const Level level)
overridevirtual

Remove a level-scoped rule.

Parameters
levelLevel selector.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ NoThrottle() [5/6]

Log & StormByte::Logger::ThreadedLog::NoThrottle ( const ThrottleSpec spec)
overridevirtual

Remove a throttle rule under the line lock.

Parameters
specSelectors of the rule to remove.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ NoThrottle() [6/6]

Log & StormByte::Logger::ThreadedLog::NoThrottle ( GroupManip  group)
overridevirtual

Remove a group-scoped rule.

Parameters
groupGroup selector.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ operator<<() [1/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( bool  v)
inline

◆ operator<<() [2/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( char  v)
inline

◆ operator<<() [3/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( ColorManip  manip)
inline

Apply a configured or explicit content color.

Parameters
manipColor manipulator.
Returns
Reference to this logger.

◆ operator<<() [4/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( ComponentManip  manip)
inline

Push a component segment onto the current thread's stack.

Parameters
manipComponent manipulator.
Returns
Reference to this logger.

◆ operator<<() [5/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( const char *  v)
inline

◆ operator<<() [6/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( const Level level)
inline

◆ operator<<() [7/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( const wchar_t *  v)
inline

◆ operator<<() [8/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( double  v)
inline

◆ operator<<() [9/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( float  v)
inline

◆ operator<<() [10/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( FormatManip  manip)
inline

Save and activate a temporary format under the line lock.

Parameters
manipFormat manipulator.
Returns
Reference to this logger.

◆ operator<<() [11/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( GroupManip  manip)
inline

Set the producer group for the current line under the line lock.

Parameters
manipGroup manipulator.
Returns
Reference to this logger.

◆ operator<<() [12/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( HexManip  m)
inline

Dump subsequent payloads as hex bytes until nohex.

Parameters
mHex manipulator.
Returns
Reference to this logger.

◆ operator<<() [13/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( int  v)
inline

◆ operator<<() [14/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( Log &(*)(Log &) noexcept  manip)
inline

◆ operator<<() [15/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( long double  v)
inline

◆ operator<<() [16/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( long long  v)
inline

◆ operator<<() [17/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( long  v)
inline

◆ operator<<() [18/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( NoColorManip  manip)
inline

Disable color for subsequent content.

Parameters
manipNo-color manipulator.
Returns
Reference to this logger.

◆ operator<<() [19/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( NoHexManip  m)
inline

Disable hex dumps and restore default payload formatting.

Parameters
mNo-hex manipulator.
Returns
Reference to this logger.

◆ operator<<() [20/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( PopComponentManip  manip)
inline

Pop one component segment from the current thread's stack.

Parameters
manipPop-component manipulator.
Returns
Reference to this logger.

◆ operator<<() [21/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( PopFormatManip  manip)
inline

Restore a saved format under the line lock.

Parameters
manipPop-format manipulator.
Returns
Reference to this logger.

◆ operator<<() [22/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( RedactManip  m)
inline

Apply redaction policy.

State remains until noredact.

Parameters
mRedaction manipulator.
Returns
Reference to this logger.

◆ operator<<() [23/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( ResetComponentManip  manip)
inline

Clear the current thread's component stack.

Parameters
manipReset-component manipulator.
Returns
Reference to this logger.

◆ operator<<() [24/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( short  v)
inline

◆ operator<<() [25/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( signed char  v)
inline

◆ operator<<() [26/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( std::ostream &(*)(std::ostream &)  manip)
inline

◆ operator<<() [27/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( std::span< const std::byte >  v)
inline

Stream raw bytes.

Default output is Base64; hex dumps 0xHH.

Parameters
vContiguous bytes. std::vector<std::byte> converts to this span.
Returns
Reference to this logger.

◆ operator<<() [28/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( std::string_view  v)
inline

Stream UTF-8 text.

std::string converts to this view.

Parameters
vText to write.
Returns
Reference to this logger.

◆ operator<<() [29/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( std::wstring_view  v)
inline

Stream wide text.

std::wstring converts to this view.

Parameters
vWide text to write.
Returns
Reference to this logger.

◆ operator<<() [30/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( unsigned char  v)
inline

◆ operator<<() [31/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( unsigned int  v)
inline

◆ operator<<() [32/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( unsigned long long  v)
inline

◆ operator<<() [33/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( unsigned long  v)
inline

◆ operator<<() [34/34]

Log & StormByte::Logger::ThreadedLog::operator<< ( unsigned short  v)
inline

◆ operator=() [1/2]

ThreadedLog & StormByte::Logger::ThreadedLog::operator= ( const ThreadedLog )
default

Copy assignment.

Returns
Reference to this logger.
Note
Shares the Implementation and the line lock.

◆ operator=() [2/2]

ThreadedLog & StormByte::Logger::ThreadedLog::operator= ( ThreadedLog &&  )
defaultnoexcept

Move assignment.

Returns
Reference to this logger.

◆ Throttle() [1/7]

Log & StormByte::Logger::ThreadedLog::Throttle ( ComponentManip  component,
const Level level,
GroupManip  group,
double  rate,
std::size_t  burst,
ThrottlePolicy  policy = ThrottlePolicy::Drop,
std::size_t  value = 0,
std::size_t  period = 0 
)
overridevirtual

Install an exact component/level/group rule.

Parameters
componentComponent path used as-is.
levelLevel selector.
groupGroup selector.
rateLines per second.
burstToken capacity.
policyCount policy.
valueSampleN or WindowKeep.
periodWindowPeriod when policy is Window.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Throttle() [2/7]

Log & StormByte::Logger::ThreadedLog::Throttle ( ComponentManip  component,
double  rate,
std::size_t  burst 
)
overridevirtual

Install a component-scoped Drop rule.

The manipulator path is used as-is.

Parameters
componentComponent path.
rateLines per second.
burstToken capacity.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Throttle() [3/7]

Log & StormByte::Logger::ThreadedLog::Throttle ( const Level level,
double  rate,
std::size_t  burst 
)
overridevirtual

Install a level-scoped Drop rule.

Parameters
levelLevel selector.
rateLines per second.
burstToken capacity.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Throttle() [4/7]

Log & StormByte::Logger::ThreadedLog::Throttle ( const ThrottleSpec spec)
overridevirtual

Install a throttle rule under the line lock.

Parameters
specRule to install. An absent Component uses the sticky path when scoped.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Throttle() [5/7]

Log & StormByte::Logger::ThreadedLog::Throttle ( double  rate,
std::size_t  burst 
)
overridevirtual

Install a Drop rule (global, or sticky path if scoped).

Parameters
rateLines per second.
burstToken capacity.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Throttle() [6/7]

Log & StormByte::Logger::ThreadedLog::Throttle ( double  rate,
std::size_t  burst,
ThrottlePolicy  policy,
std::size_t  value,
std::size_t  period = 0 
)
overridevirtual

Install a Sample or Window rule (global, or sticky path if scoped).

Parameters
rateLines per second.
burstToken capacity.
policySample or Window.
valueSampleN or WindowKeep.
periodWindowPeriod when policy is Window.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.

◆ Throttle() [7/7]

Log & StormByte::Logger::ThreadedLog::Throttle ( GroupManip  group,
double  rate,
std::size_t  burst 
)
overridevirtual

Install a group-scoped Drop rule.

Parameters
groupGroup selector.
rateLines per second.
burstToken capacity.
Returns
Reference to this logger.

Reimplemented from StormByte::Logger::Log.


The documentation for this class was generated from the following file: