]> Cypherpunks repositories - gostls13.git/commit
log/slog: document atomicity guarantees and ordering limitations of handlers
authorJoe Tsai <joetsai@digital-static.net>
Tue, 13 Feb 2024 23:34:26 +0000 (15:34 -0800)
committerJonathan Amsterdam <jba@google.com>
Thu, 15 Feb 2024 14:35:48 +0000 (14:35 +0000)
commitcfe7f21dd55fca8250c34bae8837d241f4a9876e
treee0c0b79cd133db813bb06b12b1776076c882d5ae
parent48d899dcdbed4534ed942f7ec2917cf86b18af22
log/slog: document atomicity guarantees and ordering limitations of handlers

The new wording is slightly more strict than before in that
it guarantees each Write only contains exactly one Record,
while the previous wording opened up the possibility for
multiple Records in a Write call.

We also add a comment about the lack of sorting guarantees for
concurrently logged Records. That is, the obtained lock only covers
the Write call, rather than the combination of the call to time.Now,
JSON/text serialization, and also the Write call.

Change-Id: Ia65c50579215a35a1f5b2952c6954ddb60e7fe66
Reviewed-on: https://go-review.googlesource.com/c/go/+/563976
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/log/slog/doc.go