libosmocore 0.9.6-23.20170220git32ee5af8.fc42
Osmocom core library
Loading...
Searching...
No Matches
Osmocom ringbuffer-backed logging

Files

file  loggingrb.h
 

Functions

size_t log_target_rb_used_size (struct log_target const *target)
 Return the number of log strings in the osmo_strrb-backed target.
 
size_t log_target_rb_avail_size (struct log_target const *target)
 Return the capacity of the osmo_strrb-backed target.
 
const char * log_target_rb_get (struct log_target const *target, size_t logindex)
 Return the nth log entry in a target.
 
struct log_targetlog_target_create_rb (size_t size)
 Create a new logging target for ringbuffer-backed logging.
 

Detailed Description

Function Documentation

◆ log_target_create_rb()

struct log_target * log_target_create_rb ( size_t size)

Create a new logging target for ringbuffer-backed logging.

Parameters
[in]sizeThe capacity (number of messages) of the logging target.
Returns
A log target in case of success, NULL in case of error.

References log_target_create(), log_target_destroy(), LOG_TGT_TYPE_STRRB, osmo_strrb_create(), log_target::output, osmo_strrb::size, and log_target::type.

◆ log_target_rb_avail_size()

size_t log_target_rb_avail_size ( struct log_target const * target)

Return the capacity of the osmo_strrb-backed target.

Parameters
[in]targetThe target to search.

Note that this is the capacity (aka max number of messages). It is not the number of unused message slots.

Returns
The number of log strings in the osmo_strrb-backed target.

References osmo_strrb::size.

◆ log_target_rb_get()

const char * log_target_rb_get ( struct log_target const * target,
size_t logindex )

Return the nth log entry in a target.

Parameters
[in]targetThe target to search.
[in]logindexThe index of the log entry/error message.
Returns
A pointer to the nth message, or NULL if logindex is invalid.

References osmo_strrb_get_nth().

◆ log_target_rb_used_size()

size_t log_target_rb_used_size ( struct log_target const * target)

Return the number of log strings in the osmo_strrb-backed target.

Parameters
[in]targetThe target to search.
Returns
The number of log strings in the osmo_strrb-backed target.

References osmo_strrb_elements().