Skip to content

Version 1.1.0

Choose a tag to compare

@StormBytePP StormBytePP released this 13 Sep 19:23
· 18 commits to master since this release

[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 %g is absent.
  • Sticky per-thread component("name"), reset_component and %c. component("") selects the root without throwing, while reset_component is the canonical reset. The state belongs to the thread, not the Log; two Log instances on one thread observe the same component.
  • ANSI colors by Level and component override, with color, color(Color::X) and nocolor. Color output is disabled by default.
  • Persistent general and component formats, plus nested push_format / pop_format; an empty pop_format is 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 selective FlushThrottle(spec) for pending drop summaries at job boundaries.

Changed

  • Requires StormByte Base 1.1.0 or newer (Exception with Component). Logger did not use the two-string Exception constructor.
  • Warning, Error and Fatal are always emitted, even when the configured floor is higher. This is intentional.
  • Expanded ThreadedLog coverage for the filtered hot path, wide conversion before locking, and recovery when Unicode conversion fails.

Fixed

  • ThreadedLog::FlushThrottle preserves ownership of an already-held line lock.
  • Format changes now reset the active throttle line snapshot after closing an open line.
  • endl releases the ThreadedLog line lock even if WillWrite() 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 noexcept path.
  • ThreadedLog::Write(Level) — two threads sharing a ThreadedLog raced on Implementation’s optional<Color> (m_content_color.reset() at the start of a line). The level token now takes the line lock like other Write overloads; payload and endl already did.