CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
LogChannel Struct Reference

#include <log.h>

Public Member Functions

 atomic (int32) maxlevel
 
 atomic (int32) destlevel
 
 atomic (ptr) ring
 
 atomic (uint32) groupmask
 
 atomic (uint32) sample
 Keep one record in N; 0 or 1 is every record.
 
 atomic (uint32) samplecnt
 Arrivals so far, for the sampling decision.
 

Data Fields

string path
 Full channel path.
 
struct LogChannelparent
 Parent channel, NULL for the root channel.
 
uint32 idx
 Stable index into the routing table.
 
uint32 gatedepth
 Depth of the deepest restricted ancestor-or-self.
 
flags_t flags
 Visibility and policy flags.
 
bool ownring
 This channel's ring is its own, not inherited.
 

Detailed Description

Log channel for filtering and organizing log messages

Channels are the routing key of the log system. They are named by a /-separated hierarchical path (net/http/request), interned in a process-wide registry so that the same path always yields the same channel, and permanent for the lifetime of the process – a channel pointer cached at a call site never dangles, even across logShutdown()/logRestart().

Obtain one with logChan(); declare policy for one with logDeclareChan().

Definition at line 148 of file log.h.

Member Function Documentation

◆ atomic() [1/4]

LogChannel::atomic ( int32  )

Highest level a destination wants on this channel, -1 for none

The same number as maxlevel whenever no ring is open. The difference between the two is exactly the set of records that exist only because something is retaining them, which is what the retroactive debug ring keeps and what it would otherwise duplicate.

◆ atomic() [2/4]

LogChannel::atomic ( int32  )

Highest level anything wants on this channel, -1 for none

This is the gate the call site checks, and it accounts for retention rings as well as destinations: a ring wants entries no destination asked for, and an entry that fails this check never exists at all (see Retention Rings).

◆ atomic() [3/4]

LogChannel::atomic ( ptr  )

Retroactive debug ring covering this channel, or NULL; see logChanSetDebugRing()

Inherited down the path, so configuring one on net covers net/http/request too.

◆ atomic() [4/4]

LogChannel::atomic ( uint32  )

Drain groups this channel's destinations live in, one bit per group

Maintained automatically as destinations are registered and moved between groups; there is normally no need to read or set this directly.


The documentation for this struct was generated from the following file: