Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Cloud Logging rejects entries above 256 KiB outright — they vanish rather // than being truncated — so oversized entries must be reduced before being // written. The default leaves headroom for agent-added metadata. DefaultEntryLimit = 200 * 1024 // When an entry exceeds the entry limit, strings above this length are // truncated. DefaultStringLimit = 4 * 1024 // TruncatedKey marks entries that were reduced to fit the entry limit. TruncatedKey = "log.truncated" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
Writer guards an underlying writer against oversized log entries. Each Write call is expected to carry one entry (as slog handlers do). Entries within the limit pass through untouched; oversized ones are reduced by truncating long strings throughout the entry, and, failing that, by falling back to a minimal entry retaining the time, severity, message and error message.
Click to show internal directories.
Click to hide internal directories.