Releases: StormBytePP/StormByte-Logger
Release list
Version 1.2.0
[Summary]
StormByte Logger is the stream-logging module of the StormByte C++ suite.
It depends on StormByte Base 1.2.0 or newer. This repository is not Base, Buffer, Config, Crypto, Database, Multimedia, Network or System.
Public headers under StormByte/logger/ cover Log, ThreadedLog, header formats (%L %T %i %c %g), hierarchical components and Scope facades, groups, ANSI colors, temporary formats, human-readable numbers and bytes, redaction of text and numbers, hex dumps (hex / nohex), and binary payloads (std::span<const std::byte>, default Base64).
If you landed here from a release link and have not read the tree:
- What this module is, how to build it, and short examples: README.md
- License: GNU Lesser General Public License version 3 or later, LICENSE
Added
Log::Enabled(Level): print-floor query (Warning/Error/Fatal always true). Does not open a line and does not consult throttle.operator<<(std::string_view)andoperator<<(std::wstring_view)onLogandThreadedLog, with the same filtered early-out as other payloads.std::string/std::wstringconvert to the views.hex/hex(N)/nohex: dump subsequent payloads as spaced0xAAbytes.Nis bytes per row (default 16); wrap uses a raw newline without a new header and without ending the logical line.hex(0)isnohex. Applies to text, wide text (after UTF-8), numbers (42→ bytes of"42") and binary spans. Hex runs before redaction.operator<<(std::span<const std::byte>)onLogandThreadedLog. Default output is Base64 (StormByte::Base64Encode).std::vector<std::byte>converts to the span. Withhexthe dump is the raw bytes, not the Base64 text. Empty spans emit an empty payload.ThreadedLogformats the payload before taking the line lock (FormatBinary+WritePrepared).- Hierarchical components:
component("A")pushes a thread-local segment; nested pushes join with/for%cand config lookup.pop_componentpops one segment.reset_componentstill clears the stack.component("")does not push. Log::Scope(path)returns astd::shared_ptr<Log>facade with a sticky component path. NestedScopejoins relative to the parent. Never returnsnullptr. Facades share the backend and, onThreadedLog, the line lock. A Scope line uses the sticky path, not the TLS stack.- Protected
Clonable<Log, std::shared_ptr<Log>>onLog(Clone/Move) soScopecan copy the facade without exposing cloning in the public API. - Pointer
operator<<acceptsshared_ptr/unique_ptrwhose element typeType::DerivedFromLog(LogandThreadedLog).
Changed
- Dropped the dedicated
operator<<(const std::string&)/operator<<(const std::wstring&)overloads. Call sites that passstd::stringstill compile. ThreadedLogwide payloads encode withString::UTF8Encode(std::wstring_view)before taking the line lock.- Bundled StormByte Base is 1.2.0. Using
UTF8Encode(std::wstring_view)andBase64Encode(std::span<const std::byte>)requires Base 1.2.0 or newer. - Breaking:
no_redactis nownoredact, same shape asnocolor,nohexandnohumanreadable. There is no compatibility alias. - Breaking:
component("name")pushes onto the thread-local stack instead of replacing the current name. Sibling switches mustreset_componentorpop_componentfirst, otherwisecomponent("Media")thencomponent("Other")becomesMedia/Other. - Format and color lookup use the longest matching component-path prefix, then the general setting. A child format may introduce
%c/%geven when the parent format does not. - Throttle still picks the most specific rule; component matching is by path prefix and longer paths win.
Format/Color/Throttlewithout a component argument bind to the current facade path (Scopeleaf, or global on the root logger). - README documents the component stack,
Scope, hex dumps and binary payloads.
Fixed
~Implementationno longer first-touches thread-local line state (Valgrind still-reachable TLS at exit).- Inherited throttle rules keep one spec per prefix but one counter set per emitting path. A parent
Scope("Multimedia").Throttle(Debug, …)no longer letsEncoderconsumewatermarktokens or printwatermark dropped N messageswhen that leaf had not emitted anything at that level. Drop summaries stay on the leaf that dropped. Tests coverLogandThreadedLog.
Version 1.1.1
[Summary]
StormByte Logger is the stream-logging module of the StormByte C++ suite.
It depends on StormByte Base 1.1.0 or newer. This repository is not Base, Buffer, Config, Crypto, Database, Multimedia, Network or System.
Public headers under StormByte/logger/ cover Log, ThreadedLog, header formats (%L %T %i %c %g), components, groups, ANSI colors, temporary formats, human-readable numbers and bytes, and redaction of text and numbers.
If you landed here from a release link and have not read the tree:
- What this module is, how to build it, and short examples: README.md
- License: GNU Lesser General Public License version 3 or later, LICENSE
Changed
Version 1.1.0
[Summary]
StormByte Logger is the stream-logging module of the StormByte C++ suite.
It depends on StormByte Base 1.1.0 or newer. This repository is not Base, Buffer, Config, Crypto, Database, Multimedia, Network or System.
Public headers under StormByte/logger/ cover Log, ThreadedLog, header formats (%L %T %i %c %g), components, groups, ANSI colors, temporary formats, human-readable numbers and bytes, and redaction of text and numbers.
If you landed here from a release link and have not read the tree:
- What this module is, how to build it, and short examples: README.md
- License: GNU Lesser General Public License version 3 or later, LICENSE
Added
group("name")and%g; the group is cleared by newline and is not rendered in the body when%gis absent.- Sticky per-thread
component("name"),reset_componentand%c.component("")selects the root without throwing, whilereset_componentis the canonical reset. The state belongs to the thread, not theLog; twoLoginstances on one thread observe the same component. - ANSI colors by
Leveland component override, withcolor,color(Color::X)andnocolor. Color output is disabled by default. - Persistent general and component formats, plus nested
push_format/pop_format; an emptypop_formatis idempotent. - Expanded tests for colors, temporary formats, groups, components, threads, Unicode and lock recovery.
- Added configurable line throttle policies (
Drop,Sample,Window) with component/level/group rule precedence and drop summaries. - Added
FlushThrottle()and selectiveFlushThrottle(spec)for pending drop summaries at job boundaries.
Changed
- Requires StormByte Base 1.1.0 or newer (
ExceptionwithComponent). Logger did not use the two-stringExceptionconstructor. Warning,ErrorandFatalare always emitted, even when the configured floor is higher. This is intentional.- Expanded
ThreadedLogcoverage for the filtered hot path, wide conversion before locking, and recovery when Unicode conversion fails.
Fixed
ThreadedLog::FlushThrottlepreserves ownership of an already-held line lock.- Format changes now reset the active throttle line snapshot after closing an open line.
endlreleases theThreadedLogline lock even ifWillWrite()changes midway through a line.- Wide-string logging converts before acquiring the lock; a Unicode conversion error no longer terminates the logger from an internal
noexceptpath. - ThreadedLog::Write(Level) — two threads sharing a
ThreadedLograced onImplementation’soptional<Color>(m_content_color.reset()at the start of a line). The level token now takes the line lock like otherWriteoverloads; payload andendlalready did.
Version 1.0.0
[Summary]
StormByte Logger is the stream-logging module of the StormByte C++ suite.
It depends on StormByte Base. This repository is not Base, Buffer, Config, Crypto, Database, Multimedia, Network or System.
Public headers under StormByte/logger/ cover Log, ThreadedLog, header formats (%L %T %i), human-readable numbers and bytes, and redaction of text and numbers.
If you landed here from a release link and have not read the tree:
- What this module is, how to build it, and short examples: README.md
- License: GNU Lesser General Public License version 3 or later, LICENSE
Initial public release of StormByte Logger.
Added
Logstreaming facade withoperator<<- Level filter:
LowLevel,Debug,Warning,Notice,Info,Error,Fatal - Header format:
%L,%T,%i,%% - Manipulators:
humanreadable_number,humanreadable_bytes,nohumanreadable - Redaction:
redact/redact(N)keep last N;redact_first(N)keep first N;no_redact; applies to text and numbers ThreadedLog: one lock per logical line; filtered messages do not take the lock- Uses StormByte Base (
String,ThreadLock, platform) - Unit tests (filter, threads, redaction)
- Project version read from the
VERSIONfile - CMake 3.28 floor
Notes
Logis not thread-safe. UseThreadedLogwhen several threads share one logger.- Messages below the print level return early.
- Needs a C++26 compiler and StormByte Base ≥ 1.0.0.