libosmocore 1.11.0.30-c17053.202507072026
Osmocom core library
Loading...
Searching...
No Matches
log_target Struct Reference

structure representing a logging target More...

#include <logging.h>

Data Fields

struct llist_head entry
 linked list
 
int filter_map
 Internal data for filtering.
 
voidfilter_data [LOG_MAX_FILTERS+1]
 Internal data for filtering.
 
struct log_categorycategories
 logging categories
 
uint8_t loglevel
 global log level
 
unsigned int use_color:1
 should color be used when printing log messages?
 
unsigned int print_timestamp:1
 should log messages be prefixed with a timestamp?
 
unsigned int print_tid:1
 should log messages be prefixed with the logger Thread ID?
 
unsigned int print_filename:1
 DEPRECATED: use print_filename2 instead.
 
unsigned int print_category:1
 should log messages be prefixed with a category name?
 
unsigned int print_ext_timestamp:1
 should log messages be prefixed with an extended timestamp?
 
enum log_target_type type
 the type of this log taget
 
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
 
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.
 
bool print_level
 
bool print_category_hex
 
enum log_filename_type print_filename2
 
enum log_filename_pos print_filename_pos
 

Detailed Description

structure representing a logging target

Field Documentation

◆ [union]

union { ... } log_target

◆ categories

struct log_category* log_target::categories

logging categories

Referenced by log_cache_update(), log_cache_update_all(), and log_parse_category_mask().

◆ entry

◆ facility

int log_target::facility

◆ filter_data

void* log_target::filter_data[LOG_MAX_FILTERS+1]

Internal data for filtering.

◆ filter_map

int log_target::filter_map

Internal data for filtering.

◆ fname

const char* log_target::fname

◆ gsmtap_inst

struct gsmtap_inst* log_target::gsmtap_inst

◆ hostname

const char* log_target::hostname

◆ ident

const char* log_target::ident

◆ loglevel

uint8_t log_target::loglevel

global log level

Referenced by log_cache_update(), and log_cache_update_all().

◆ out

FILE* log_target::out

◆ 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]targetlogging target
[in]levellog level of currnet message
[in]stringthe string that is to be written to the log

◆ print_category

unsigned int log_target::print_category

should log messages be prefixed with a category name?

Referenced by log_set_print_category().

◆ print_category_hex

bool log_target::print_category_hex

◆ print_ext_timestamp

unsigned int log_target::print_ext_timestamp

should log messages be prefixed with an 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

◆ print_filename_pos

enum log_filename_pos log_target::print_filename_pos

◆ print_level

bool log_target::print_level

Referenced by 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_set_print_tid().

◆ print_timestamp

unsigned int log_target::print_timestamp

should log messages be prefixed with a timestamp?

Referenced by log_set_print_extended_timestamp(), and log_set_print_timestamp().

◆ priority

int log_target::priority

◆ raw

bool log_target::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]targetlogging target
[in]subsyslogging sub-system
[in]levellogging level
[in]filesoure code file name
[in]linesource code file line number
[in]contcontinuation of previous statement?
[in]formatformat string
[in]apvararg list of printf arguments

◆ rb

void* log_target::rb

◆ [struct]

struct { ... } log_target::sd_journal

◆ [struct]

struct { ... } log_target::tgt_file

◆ [struct]

struct { ... } log_target::tgt_gsmtap

◆ [struct]

struct { ... } log_target::tgt_rb

◆ [struct]

struct { ... } log_target::tgt_syslog

◆ [struct]

struct { ... } log_target::tgt_vty

◆ type

enum log_target_type log_target::type

the type of this log taget

Referenced by log_target_find().

◆ use_color

unsigned int log_target::use_color

should color be used when printing log messages?

Referenced by log_set_use_color().

◆ vty

void* log_target::vty

◆ wqueue

struct osmo_wqueue* log_target::wqueue

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