libosmocore 0.9.6-23.20170220git32ee5af8.fc42
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.
 
void * filter_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_filename:1
 should log messages be prefixed with a filename?
 
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 
 
   }   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 
 
};  
 
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. bypassing the internal string formatter
 

Detailed Description

structure representing a logging target

Field Documentation

◆ 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

Referenced by log_target_create_file(), log_target_create_rb(), log_target_create_stderr(), log_target_create_syslog(), and log_target_destroy().

◆ 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

Referenced by log_target_create_gsmtap(), and osmo_vlogp().


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