Skip to content

Commit

Permalink
doc: logging: clarify per-thread buffering
Browse files Browse the repository at this point in the history
Log buffer flushing is thread-local.

Signed-off-by: David Lamparter <equinox@diac24.net>
  • Loading branch information
eqvinox committed Apr 7, 2020
1 parent 8d0a291 commit 6c19e55
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/developer/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,12 @@ message buffers in order to improve logging performance. The following rules
apply for this buffering:
* Only messages of priority *DEBUG* or *INFO* are buffered.
* Any higher-priority message causes the entire buffer to be flushed, thus
message ordering is preserved properly.
* Any higher-priority message causes the thread's entire buffer to be flushed,
thus message ordering is preserved on a per-thread level.
* There is no guarantee on ordering between different threads; in most cases
this is arbitrary to begin with since the threads essentially race each
other in printing log messages. If an order is established with some
synchronization primitive, add calls to :c:func:`zlog_tls_buffer_flush()`.
* The buffers are only ever accessed by the thread they are created by. This
means no locking is necessary.
Expand Down

0 comments on commit 6c19e55

Please sign in to comment.