libosmocore 1.13.1.1-afb4 Osmocom core library

Files | Data Structures | Macros | Functions | Variables
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_info * | osmo_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 | ) |

References OSMO_ASSERT, and osmo_log_info.

Referenced by log_check_level(), log_parse_category(), log_parse_category_mask(), and log_target_create().

## ◆ 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] | buf | caller-allocated output buffer for the generated string
  [in] | buf_len | number of bytes available in buf
  [in] | target | log target for which the string is to be formatted
  [in] | subsys | Log sub-system number
  [in] | level | Log level
  [in] | file | name of source code file generating the log
  [in] | line | line source code line number within 'file' generating the log
  [in] | cont | is this a continuation (true) or not (false)
  [in] | format | format string
  [in] | ap | variable 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()

void log_target_file_destroy | ( | struct log_target * | target | ) |

References osmo_wqueue::bfd, osmo_wqueue::except_cb, osmo_fd::fd, log_target::fname, LOG_TGT_TYPE_FILE, LOG_TGT_TYPE_STDERR, OSMO_ASSERT, osmo_iofd_free(), log_target::out, log_target::tgt_file, log_target::type, and log_target::wqueue.

Referenced by log_target_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

struct log_info* osmo_log_info
| extern

Referenced by assert_loginfo(), color(), log_cache_enable(), log_cache_update_all(), log_category_name(), log_fini(), log_init(), log_parse_category(), log_parse_category_mask(), log_target_create(), map_subsys(), should_log_to_target(), and subsys_lib2index().

## ◆ osmo_log_target_list

struct llist_head osmo_log_target_list
| extern

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

## ◆ tall_log_ctx

void* tall_log_ctx
| extern

Referenced by log_fini(), log_init(), and log_target_create().