Simple buffer management.
LogWireDecoder * logWireDecoderCreate(void)
struct LogWireDecoder LogWireDecoder
Opaque decoder; one per connection.
LogWireEncoder * logWireEncoderCreate(strref origin, flags_t flags)
struct LogWireEncoder LogWireEncoder
Opaque encoder; one per connection.
LOG_WIRE_FLAGS
Encoder options.
bool logWireDecode(LogWireDecoder *dec, const uint8 *buf, size_t len, LogWireFrameCB cb, void *ctx)
bool logWireEncodeGap(LogWireEncoder *enc, Buffer *out, uint64 n, uint64 firstseq, uint64 lastseq)
bool logWireEncode(LogWireEncoder *enc, Buffer *out, const LogRecord *rec)
void logWireDecoderDestroy(LogWireDecoder **dec)
bool logInject(strref chanpath, const LogWireRecord *rec)
void logWireEncoderDestroy(LogWireEncoder **enc)
bool logWireEncodeSub(LogWireEncoder *enc, Buffer *out, const LogSubSpec *spec)
void logWireEndSegment(LogWireEncoder *enc)
bool logWireEncodeCatalog(LogWireEncoder *enc, Buffer *out, _In_reads_(nchans) const LogWireChanInfo *chans, int nchans)
bool(* LogWireFrameCB)(const LogWireFrame *frame, void *ctx)
@ LOG_WireSiteDecl
Declares a call site's message template, for this segment.
@ LOG_WireSubscribe
A receiver asking for a set of channels and levels.
@ LOG_WireChanDecl
Declares a channel path and its policy, for this segment.
@ LOG_WireCatalog
What a sender is capable of logging.
@ LOG_WireEntry
One log record.
@ LOG_WireGap
Records that were dropped rather than sent.
@ LOG_WireSegment
Opens a segment; everything declared in the old one is forgotten.
#define stvar(typen, val)
Per-thread log context: fields every record on this thread inherits.
Dynamic arrays with type-safe generic programming.
int maxlevel
Most verbose level wanted. A sender clamps this to what it was configured to allow.
const LogWireChanInfo * chans
Channels the sender has interned.
int nchans
Number of channels.
One channel in a sender's catalog.
flags_t flags
Policy flags at the sender (LOG_Restricted, LOG_Broadcast, ...)
int maxlevel
Most verbose level anything at the sender currently wants on it.
const LogWireGap * gap
LOG_WireGap.
const LogSubSpec * sub
LOG_WireSubscribe.
const LogWireCatalog * cat
LOG_WireCatalog.
const LogWireRecord * rec
LOG_WireEntry.
uint64 count
How many records were dropped.
uint64 firstseq
Sequence number of the first one.
uint64 lastseq
Sequence number of the last one.
int level
Severity the sender logged it at.
strref chanpath
Channel path the sender logged it to.
int nargs
Number of arguments.
uint8 hops
Instances it has already been forwarded through.
int trigger
Severity that released it from a retention ring, or -1.
int nctx
Number of context fields.
uint64 seq
Sender's sequence number.
int64 timestamp
Sender's wall clock timestamp; never re-stamped on the way in.
strref msgtmpl
Message template, or the literal message when istmpl is false.
const stvar * args
Arguments, unkeyed ones first in their original order.
bool istmpl
msgtmpl is a format template rather than a literal message
const stvar * ctx
Context fields that were in scope at the sender, all keyed.
flags_t chanflags
The channel's policy flags at the sender (LOG_Restricted etc.)
uint32 batchid
Sender's batch id.
strref origin
Instance it was originally logged on.
uint32 sample
Sampling rate this record survived at the sender.