libosmocore 1.13.1.12-8e6ea
Osmocom core library
Osmocom logging internals

Files

file  logging_internal.h
 

Data Structures

struct  log_thread_state
 

Macros

#define MAX_LOG_SIZE   4096
 
#define LOG_WQUEUE_LEN   156
 

Functions

void assert_loginfo (const char *src)
 
int log_output_buf (char *buf, int buf_len, struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
 main output formatting function for log lines. More...
 
void log_target_file_destroy (struct log_target *target)
 

Variables

void * tall_log_ctx
 
struct log_infoosmo_log_info
 
const struct value_string loglevel_strs []
 
struct llist_head osmo_log_target_list
 
__thread struct log_thread_state log_thread_state
 

Detailed Description

Macro Definition Documentation

◆ LOG_WQUEUE_LEN

#define LOG_WQUEUE_LEN   156

◆ MAX_LOG_SIZE

#define MAX_LOG_SIZE   4096

Function Documentation

◆ assert_loginfo()

void assert_loginfo ( const char *  src)

◆ log_output_buf()

int log_output_buf ( char *  buf,
int  buf_len,
struct log_target target,
unsigned int  subsys,
unsigned int  level,
const char *  file,
int  line,
int  cont,
const char *  format,
va_list  ap 
)

main output formatting function for log lines.

Parameters
[out]bufcaller-allocated output buffer for the generated string
[in]buf_lennumber of bytes available in buf
[in]targetlog target for which the string is to be formatted
[in]subsysLog sub-system number
[in]levelLog level
[in]filename of source code file generating the log
[in]lineline source code line number within 'file' generating the log
[in]contis this a continuation (true) or not (false)
[in]formatformat string
[in]apvariable argument list for format
Returns
number of bytes written to out

References osmo_strbuf::buf, color(), const_basename(), file(), level, level_color(), log_category_name(), LOG_FILENAME_BASENAME, LOG_FILENAME_NONE, LOG_FILENAME_PATH, LOG_FILENAME_POS_HEADER_END, LOG_FILENAME_POS_LINE_END, log_level_str(), osmo_gettid(), osmo_gettimeofday(), OSMO_LOGCOLOR_END, OSMO_STRBUF_ADDED_TAIL, OSMO_STRBUF_APPEND, OSMO_STRBUF_CHAR_COUNT, OSMO_STRBUF_DROP_TAIL, OSMO_STRBUF_PRINTF, OSMO_STRBUF_REMAIN, osmo_strbuf::pos, log_target::print_category, log_target::print_category_hex, log_target::print_ext_timestamp, log_target::print_filename2, log_target::print_filename_pos, log_target::print_level, log_target::print_tid, log_target::print_timestamp, subsys, log_thread_state::tid, time, and log_target::use_color.

Referenced by _file_raw_output(), and osmo_vlogp().

◆ log_target_file_destroy()

Variable Documentation

◆ log_thread_state

__thread struct log_thread_state log_thread_state
extern

◆ loglevel_strs

const struct value_string loglevel_strs[]
extern

Referenced by log_level_str(), and log_parse_level().

◆ osmo_log_info

◆ osmo_log_target_list

◆ tall_log_ctx

void* tall_log_ctx
extern