libosmocore 1.13.1.1-afb4 Osmocom core library

Data Fields
log_target Struct Reference
Osmocom logging framework

`#include <logging.h>`

## Data Fields
struct llist_head | entry
| linked list More...
int filter_map | OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET
| Internal data for filtering. More...
void *filter_data[LOG_MAX_FILTERS+1] | OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET
| Internal data for filtering. More...
struct log_category * | categories
| logging categories More...
uint8_t | loglevel
| global log level More...
unsigned int | use_color:1
| should color be used when printing log messages? More...
unsigned int | print_timestamp:1
| should log messages be prefixed with a timestamp? More...
unsigned int | print_tid:1
| should log messages be prefixed with the logger Thread ID? More...
unsigned int | print_filename:1
| DEPRECATED: use print_filename2 instead. More...
unsigned int | print_category:1
| should log messages be prefixed with a category name? More...
unsigned int | print_ext_timestamp:1
| should log messages be prefixed with an extended timestamp? More...
enum log_target_type | type
| the type of this log taget More...
union {
struct {
FILE * out
const char * fname
struct osmo_wqueue * wqueue
} tgt_file
struct {
int priority
int facility
} tgt_syslog
struct {
void * vty
} tgt_vty
struct {
void * rb
} tgt_rb
struct {
struct gsmtap_inst * gsmtap_inst
const char * ident
const char * hostname
} tgt_gsmtap
struct {
bool raw
} sd_journal
}; |
void(* | output )(struct log_target *target, unsigned int level, const char *string)
| call-back function to be called when the logging framework wants to log a fully formatted string More...
void(* | raw_output )(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
| alternative call-back function to which the logging framework passes the unfortmatted input arguments, i.e. More...
bool | print_level
bool | print_category_hex
enum log_filename_type | print_filename2
enum log_filename_pos | print_filename_pos

## Field Documentation

## ◆

union { ... } log_target::@9

## ◆ categories

struct log_category* log_target::categories

logging categories

Referenced by log_cache_update(), log_cache_update_all(), log_parse_category_mask(), log_set_category_filter(), log_target_create(), and should_log_to_target().

## ◆ entry

struct llist_head log_target::entry

linked list

Referenced by log_add_target(), log_cache_update_all(), log_check_level(), log_del_target(), log_fini(), log_target_create(), log_target_find(), log_targets_reopen(), and osmo_vlogp().

## ◆ facility

int log_target::facility

Referenced by log_target_create_syslog().

## ◆ fname

const char* log_target::fname

Referenced by _log_target_file_setup_iofd(), log_target_create_file(), log_target_file_destroy(), log_target_file_reopen(), log_target_file_switch_to_stream(), log_target_file_switch_to_wqueue(), and log_target_find().

## ◆ gsmtap_inst

struct gsmtap_inst* log_target::gsmtap_inst

Referenced by _gsmtap_raw_output(), log_target_create_gsmtap(), and log_target_destroy().

## ◆ hostname

const char* log_target::hostname

Referenced by log_target_create_gsmtap(), and log_target_find().

## ◆ ident

const char* log_target::ident

Referenced by _gsmtap_raw_output(), log_target_create_gsmtap(), and log_target_create_syslog().

## ◆ loglevel

uint8_t log_target::loglevel

global log level

Referenced by _gsmtap_raw_output(), log_cache_update(), log_cache_update_all(), log_set_log_level(), log_target_create(), and should_log_to_target().

## ◆ OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET [1/2]

int filter_map log_target::OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET

Internal data for filtering.

## ◆ OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET [2/2]

void* filter_data [LOG_MAX_FILTERS+1] log_target::OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET

Internal data for filtering.

## ◆ out

FILE* log_target::out

Referenced by _file_output_stream(), log_target_create_file(), log_target_create_stderr(), log_target_file_destroy(), log_target_file_get_nonblock(), log_target_file_reopen(), log_target_file_set_nonblock(), log_target_file_switch_to_stream(), and log_target_file_switch_to_wqueue().

## ◆ output

void(* log_target::output) (struct log_target *target, unsigned int level, const char *string)

call-back function to be called when the logging framework wants to log a fully formatted string

Parameters

  [in] | target | logging target
  [in] | level | log level of currnet message
  [in] | string | the string that is to be written to the log

Referenced by _gsmtap_raw_output(), log_target_create_file(), log_target_create_gsmtap(), log_target_create_rb(), log_target_create_stderr(), log_target_create_syslog(), log_target_file_switch_to_stream(), log_target_file_switch_to_wqueue(), log_target_systemd_set_raw(), and osmo_vlogp().

## ◆ print_category

unsigned int log_target::print_category

should log messages be prefixed with a category name?

Referenced by log_output_buf(), and log_set_print_category().

## ◆ print_category_hex

bool log_target::print_category_hex

Referenced by log_output_buf(), log_set_print_category_hex(), and log_target_create().

## ◆ print_ext_timestamp

unsigned int log_target::print_ext_timestamp

should log messages be prefixed with an extended timestamp?

Referenced by log_output_buf(), and log_set_print_extended_timestamp().

## ◆ print_filename

unsigned int log_target::print_filename

DEPRECATED: use print_filename2 instead.

Referenced by log_set_print_filename().

## ◆ print_filename2

enum log_filename_type log_target::print_filename2

Referenced by log_output_buf(), log_set_print_filename2(), and log_target_create().

## ◆ print_filename_pos

enum log_filename_pos log_target::print_filename_pos

Referenced by log_output_buf(), and log_set_print_filename_pos().

## ◆ print_level

bool log_target::print_level

Referenced by log_output_buf(), and log_set_print_level().

## ◆ print_tid

unsigned int log_target::print_tid

should log messages be prefixed with the logger Thread ID?

Referenced by log_output_buf(), log_set_print_tid(), and log_target_create().

## ◆ print_timestamp

unsigned int log_target::print_timestamp

should log messages be prefixed with a timestamp?

Referenced by log_output_buf(), log_set_print_extended_timestamp(), log_set_print_timestamp(), and log_target_create().

## ◆ priority

int log_target::priority

## ◆ raw

bool log_target::raw

Referenced by log_target_create_systemd(), and log_target_systemd_set_raw().

## ◆ raw_output

void(* log_target::raw_output) (struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)

alternative call-back function to which the logging framework passes the unfortmatted input arguments, i.e.

bypassing the internal string formatter

Parameters

  [in] | target | logging target
  [in] | subsys | logging sub-system
  [in] | level | logging level
  [in] | file | soure code file name
  [in] | line | source code file line number
  [in] | cont | continuation of previous statement?
  [in] | format | format string
  [in] | ap | vararg list of printf arguments

Referenced by log_target_create_emscripten(), log_target_create_gsmtap(), log_target_file_switch_to_stream(), log_target_file_switch_to_wqueue(), log_target_systemd_set_raw(), and osmo_vlogp().

## ◆ rb

void* log_target::rb

Referenced by _rb_output(), log_target_create_rb(), log_target_rb_avail_size(), log_target_rb_get(), and log_target_rb_used_size().

## ◆

struct { ... } log_target::sd_journal

Referenced by log_target_systemd_set_raw().

## ◆

struct { ... } log_target::tgt_file

Referenced by _file_output_stream(), _file_raw_output(), _log_target_file_setup_iofd(), _log_target_file_setup_talloc_pool(), log_target_create_file(), log_target_create_stderr(), log_target_file_destroy(), log_target_file_get_nonblock(), log_target_file_reopen(), log_target_file_set_nonblock(), log_target_file_switch_to_stream(), log_target_file_switch_to_wqueue(), and log_target_find().

## ◆

struct { ... } log_target::tgt_gsmtap

Referenced by _gsmtap_raw_output(), log_target_create_gsmtap(), log_target_destroy(), and log_target_find().

## ◆

struct { ... } log_target::tgt_rb

Referenced by _rb_output(), log_target_create_rb(), log_target_rb_avail_size(), log_target_rb_get(), and log_target_rb_used_size().

## ◆

struct { ... } log_target::tgt_syslog

Referenced by log_target_create_syslog().

## ◆

struct { ... } log_target::tgt_vty

## ◆ type

enum log_target_type log_target::type

the type of this log taget

Referenced by log_target_create_emscripten(), log_target_create_file(), log_target_create_gsmtap(), log_target_create_rb(), log_target_create_stderr(), log_target_create_syslog(), log_target_create_systemd(), log_target_destroy(), log_target_file_destroy(), log_target_file_reopen(), log_target_file_switch_to_stream(), log_target_file_switch_to_wqueue(), log_target_find(), and log_targets_reopen().

## ◆ use_color

unsigned int log_target::use_color

should color be used when printing log messages?

Referenced by log_output_buf(), log_set_use_color(), and log_target_create().

## ◆ vty

void* log_target::vty

## ◆ wqueue

struct osmo_wqueue* log_target::wqueue

Referenced by _file_raw_output(), _log_target_file_setup_iofd(), _log_target_file_setup_talloc_pool(), log_target_file_destroy(), log_target_file_reopen(), and log_target_file_switch_to_stream().

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

- include/osmocom/core/logging.h