Loading...
Searching...
No Matches
Osmocom logging framework

libosmocore Logging sub-system More...

## Files

file | logging.h
file | logging.c
| Debugging/Logging support code.
file | logging_emscripten.c
| Logging support code using a JS callback.
file | logging_file.c
| File & stderr logging support code.
file | logging_gsmtap.c
| libosmocore log output encapsulated in GSMTAP.
file | logging_syslog.c
| Syslog logging support code.
file | logging_systemd.c

## Data Structures

struct | log_category
| Configuration of single log category / sub-system. More...
struct | log_info_cat
| Information regarding one logging category. More...
struct | log_context
| Log context information, passed to filter. More...
struct | log_info
| Logging configuration, passed to log_init. More...
struct | log_target

## Macros

#define | DEBUG
#define | DEBUGP(ss, fmt, args...)
| Log a debug message through the Osmocom logging framework.
#define | DEBUGPC(ss, fmt, args...)
#define | LOGP(ss, level, fmt, args...)
| Log a new message through the Osmocom logging framework.
#define | LOGPC(ss, level, fmt, args...)
| Continue a log message through the Osmocom logging framework.
#define | LOGPSRC(ss, level, caller_file, caller_line, fmt, args...)
| Log through the Osmocom logging framework with explicit source.
#define | LOGPSRCC(ss, level, caller_file, caller_line, cont, fmt, args...)
| Log through the Osmocom logging framework with explicit source.
#define | LOGL_DEBUG 1
| different log levels
#define | LOGL_INFO 3
| general information
#define | LOGL_NOTICE 5
| abnormal/unexpected condition
#define | LOGL_ERROR 7
| error condition, requires user action
#define | LOGL_FATAL 8
| fatal, program aborted
#define | DLGLOBAL -1
| global logging
#define | DLLAPD -2
| LAPD implementation.
#define | DLINP -3
| (A-bis) Input sub-system
#define | DLMUX -4
| Osmocom Multiplex (Osmux).
#define | DLMI -5
| ISDN-layer below input sub-system.
#define | DLMIB -6
| ISDN layer B-channel.
#define | DLSMS -7
| SMS sub-system.
#define | DLCTRL -8
| Control Interface.
#define | DLGTP -9
| GTP (GPRS Tunneling Protocol.
#define | DLSTATS -10
| Statistics.
#define | DLGSUP -11
| Generic Subscriber Update Protocol.
#define | DLOAP -12
| Osmocom Authentication Protocol.
#define | DLSS7 -13
| Osmocom SS7.
#define | DLSCCP -14
| Osmocom SCCP.
#define | DLSUA -15
| Osmocom SUA.
#define | DLM3UA -16
| Osmocom M3UA.
#define | DLMGCP -17
| Osmocom MGCP.
#define | DLJIBUF -18
| Osmocom Jitter Buffer.
#define | DLRSPRO -19
| Osmocom Remote SIM Protocol.
#define | DLNS -20
| Osmocom NS layer.
#define | DLBSSGP -21
| Osmocom BSSGP layer.
#define | DLNSDATA -22
| Osmocom NS layer data pdus.
#define | DLNSSIGNAL -23
| Osmocom NS layer signal pdus.
#define | DLIUUP -24
| Osmocom IuUP layer.
#define | DLPFCP -25
| Osmocom Packet Forwarding Control Protocol.
#define | DLCSN1 -26
| CSN.1 (Concrete Syntax Notation 1) codec.
#define | DLM2PA -27
| Osmocom M2PA (libosmo-sigtran).
#define | DLM2UA -28
| Reserved for future Osmocom M2UA (libosmo-sigtran).
#define | DLIO -29
| Osmocom IO sub-system.
#define | DLTCAP -30
| Osmocom TCAP.
#define | OSMO_NUM_DLIB 30
| Number of logging sub-systems in libraries.
#define | OSMO_LOGCOLOR_NORMAL NULL
#define | OSMO_LOGCOLOR_RED "\033[1;31m"
#define | OSMO_LOGCOLOR_GREEN "\033[1;32m"
#define | OSMO_LOGCOLOR_YELLOW "\033[1;33m"
#define | OSMO_LOGCOLOR_BLUE "\033[1;34m"
#define | OSMO_LOGCOLOR_PURPLE "\033[1;35m"
#define | OSMO_LOGCOLOR_CYAN "\033[1;36m"
#define | OSMO_LOGCOLOR_DARKRED "\033[31m"
#define | OSMO_LOGCOLOR_DARKGREEN "\033[32m"
#define | OSMO_LOGCOLOR_DARKYELLOW "\033[33m"
#define | OSMO_LOGCOLOR_DARKBLUE "\033[34m"
#define | OSMO_LOGCOLOR_DARKPURPLE "\033[35m"
#define | OSMO_LOGCOLOR_DARKCYAN "\033[36m"
#define | OSMO_LOGCOLOR_DARKGREY "\033[1;30m"
#define | OSMO_LOGCOLOR_GREY "\033[37m"
#define | OSMO_LOGCOLOR_BRIGHTWHITE "\033[1;37m"
#define | OSMO_LOGCOLOR_END "\033[0;m"
#define | LOG_MAX_CTX _LOG_CTX_COUNT
| Maximum number of logging contexts.
#define | LOG_MAX_FILTERS _LOG_FLT_COUNT
| Maximum number of logging filters.
#define | LOG_FILTER_ALL (1<<LOG_FLT_ALL)
| Compatibility with older libosmocore versions.
#define | GPRS_CTX_NSVC LOG_CTX_GB_NSVC
| Compatibility with older libosmocore versions.
#define | GPRS_CTX_BVC LOG_CTX_GB_BVC
| Compatibility with older libosmocore versions.
#define | OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET OSMO_DEPRECATED_OUTSIDE("Accessing struct log_target members directly is deprecated")
| structure representing a logging target
#define | LOG_MTX_DEBUG 0
#define | log_tgt_mutex_lock()
#define | log_tgt_mutex_unlock()
#define | TRACE(probe)
#define | TRACE_ENABLED(probe)
#define | INT2IDX(x)
#define | GSMTAP_MSG_MAX_SIZE
#define | SD_JOURNAL_SUPPRESS_LOCATION

## Typedefs

typedef int | log_filter(const struct log_context *ctx, struct log_target *target)
| Log filter function.
typedef void | log_print_filters(struct vty *vty, const struct log_info *info, const struct log_target *tgt)
typedef void | log_save_filters(struct vty *vty, const struct log_info *info, const struct log_target *tgt)

## Enumerations

enum | log_ctx_index { LOG_CTX_GB_NSVC , LOG_CTX_GB_BVC , LOG_CTX_BSC_SUBSCR , LOG_CTX_VLR_SUBSCR , LOG_CTX_L1_SAPI , LOG_CTX_GB_NSE , _LOG_CTX_COUNT }
| Indexes to indicate the object currently acted upon. More...
enum | log_filter_index { LOG_FLT_ALL , LOG_FLT_GB_NSVC , LOG_FLT_GB_BVC , LOG_FLT_BSC_SUBSCR , LOG_FLT_VLR_SUBSCR , LOG_FLT_L1_SAPI , LOG_FLT_GB_NSE , _LOG_FLT_COUNT }
| Indexes to indicate objects that should be logged. More...
enum | log_target_type { LOG_TGT_TYPE_VTY , LOG_TGT_TYPE_SYSLOG , LOG_TGT_TYPE_FILE , LOG_TGT_TYPE_STDERR , LOG_TGT_TYPE_STRRB , LOG_TGT_TYPE_GSMTAP , LOG_TGT_TYPE_SYSTEMD , LOG_TGT_TYPE_EMSCRIPTEN }
| Type of logging target. More...
enum | log_filename_type { LOG_FILENAME_NONE , LOG_FILENAME_PATH , LOG_FILENAME_BASENAME }
| Whether/how to log the source filename (and line number). More...
enum | log_filename_pos { LOG_FILENAME_POS_HEADER_END , LOG_FILENAME_POS_LINE_END }
| Where on a log line source file and line should be logged. More...

## Functions

void | osmo_vlogp (int subsys, int level, const char *file, int line, int cont, const char *format, va_list ap)
| vararg version of logging function
void | logp (int subsys, const char *file, int line, int cont, const char *format,...)
| logging function used by DEBUGP() macro
void | logp2 (int subsys, unsigned int level, const char *file, int line, int cont, const char *format,...)
| logging function used by LOGP() macro
void void | logp_stub (const char *file, int line, int cont, const char *format,...)
int | log_init (const struct log_info *inf, void *ctx)
| Initialize the Osmocom logging core.
void | log_fini (void)
int | log_check_level (int subsys, unsigned int level)
| Check whether a log entry will be generated.
void | log_reset_context (void)
| Reset (clear) the logging context.
int | log_set_context (uint8_t ctx_nr, void *value)
| Set the logging context.
void * | log_get_context (const struct log_context *ctx, uint8_t ctx_nr)
| Get the logging context.
void | log_set_all_filter (struct log_target *target, int all)
| Enable/disable the LOG_FLT_ALL log filter.
bool | log_get_filter (const struct log_target *target, int log_filter_index)
| Query whether a log filter is enabled or disabled.
int | log_set_filter (struct log_target *target, int log_filter_index, bool enable)
| Enable/disable a log filter.
void * | log_get_filter_data (const struct log_target *target, int log_filter_index)
| Obtain data associated to a log filter.
int | log_set_filter_data (struct log_target *target, int log_filter_index, void *data)
| Set data associated to a log filter.
int | log_cache_enable (void)
| Enable the log level lookup cache to bypass string formatting and other code for log statements which are not actually enabled/needed by any existing log target.
void | log_cache_update (int mapped_subsys, uint8_t enabled, uint8_t level)
| Updates single cache entry, caller must hold osmo_log_tgt_mutex.
void | log_set_use_color (struct log_target *target, int use_color)
| Enable or disable the use of colored output.
void | log_set_print_extended_timestamp (struct log_target *target, int print_timestamp)
| Enable or disable printing of extended timestamps while logging.
void | log_set_print_timestamp (struct log_target *target, int print_timestamp)
| Enable or disable printing of timestamps while logging.
void | log_set_print_tid (struct log_target *target, int print_tid)
| Enable or disable printing of timestamps while logging.
void | log_set_print_filename (struct log_target *target, int print_filename)
| Use log_set_print_filename2() instead.
void | log_set_print_filename2 (struct log_target *target, enum log_filename_type lft)
| Enable or disable printing of the filename while logging.
void | log_set_print_filename_pos (struct log_target *target, enum log_filename_pos pos)
| Set the position where on a log line the source file info should be logged.
void | log_set_print_category (struct log_target *target, int print_category)
| Enable or disable printing of the category name.
void | log_set_print_category_hex (struct log_target *target, int print_category_hex)
| Enable or disable printing of the category number in hex ('<000b>').
void | log_set_print_level (struct log_target *target, int print_level)
| Enable or disable printing of the log level name.
void | log_set_log_level (struct log_target *target, int log_level)
| Set the global log level for a given log target.
void | log_parse_category_mask (struct log_target *target, const char *_mask)
| parse the log category mask
const char * | log_category_name (int subsys)
int | log_parse_level (const char *lvl)
| Parse a human-readable log level into a numeric value.
const char * | log_level_str (unsigned int lvl)
| convert a numeric log level into human-readable string
int | log_parse_category (const char *category)
| parse a human-readable log category into numeric form
void | log_set_category_filter (struct log_target *target, int category, int enable, int level)
| Set a category filter on a given log target.
struct log_target * | log_target_create (void)
| Create a new log target skeleton.
void | log_target_destroy (struct log_target *target)
| Unregister, close and delete a log target.
struct log_target * | log_target_create_stderr (void)
| Create the STDERR log target.
struct log_target * | log_target_create_file (const char *fname)
| Create a new file-based log target using a stream.
struct log_target * | log_target_create_syslog (const char *ident, int option, int facility)
| Create a new logging target for syslog logging.
struct log_target * | log_target_create_gsmtap (const char *host, uint16_t port, const char *ident, bool ofd_wq_mode, bool add_sink)
| Create a new logging target for GSMTAP logging.
struct log_target * | log_target_create_systemd (bool raw)
| Create a new logging target for systemd journal logging.
struct log_target * | log_target_create_emscripten (void)
| Create a new logging target for JS callback logging (uses on_log).
void | log_target_systemd_set_raw (struct log_target *target, bool raw)
| Change meta information handling of an existing logging target.
int | log_target_file_reopen (struct log_target *target)
| close and re-open a log file (for log file rotation)
int | log_target_file_switch_to_stream (struct log_target *target)
| switch from non-blocking/write-queue to blocking + buffered stream output
int | log_target_file_switch_to_wqueue (struct log_target *target)
| switch from blocking + buffered file output to non-blocking write-queue based output.
int | log_target_file_get_nonblock (const struct log_target *target)
| Find whether the log target fd is configured as non-blocking (see sockopt O_NONBLOCK).
int | log_target_file_set_nonblock (struct log_target *target, int on)
| Set the log target fd as non-blocking (see sockopt O_NONBLOCK).
int | log_targets_reopen (void)
| close and re-open all log files (for log file rotation)
void | log_add_target (struct log_target *target)
| Register a new log target with the logging core.
void | log_del_target (struct log_target *target)
| Unregister a log target from the logging core.
struct log_target * | log_target_find (enum log_target_type type, const char *fname)
| Find a registered log target.
void | log_enable_multithread (void)
| Enable multithread support (mutex) in libosmocore logging system.
void | log_tgt_mutex_lock_impl (void)
| Acquire the osmo_log_tgt_mutex.
void | log_tgt_mutex_unlock_impl (void)
| Release the osmo_log_tgt_mutex.
| osmo_static_assert (_LOG_CTX_COUNT<=ARRAY_SIZE(((struct log_context *) NULL) ->ctx), enum_logging_ctx_items_fit_in_struct_log_context)
| osmo_static_assert (_LOG_FLT_COUNT<=ARRAY_SIZE(((struct log_target *) NULL) ->filter_data), enum_logging_filters_fit_in_log_target_filter_data)
| osmo_static_assert (_LOG_FLT_COUNT<=8 *sizeof(((struct log_target *) NULL) ->filter_map), enum_logging_filters_fit_in_log_target_filter_map)
| LLIST_HEAD (osmo_log_target_list)
static void | log_cache_update_all (void)
| Updates cache for all targets for all categies, caller must hold osmo_log_tgt_mutex.
static bool | log_cache_check (int mapped_subsys, int level)
| Queries log level cache.
void | assert_loginfo (const char *src)
static int | subsys_lib2index (int subsys)
static const char * | color (int subsys)
static const char * | level_color (int level)
static const char * | const_basename (const char *path)
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.
static int | map_subsys (int subsys)
static bool | should_log_to_target (struct log_target *tar, int subsys, int level)
| EM_JS (void, on_log_wrapper,(const char *subsys, int level, const char *msg), { return on_log(subsys, level, msg);})
static void | _emscripten_raw_output (struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
void | log_target_file_destroy (struct log_target *target)
static void | _file_output_stream (struct log_target *target, unsigned int level, const char *log)
static void | _file_raw_output (struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
void | _log_target_file_setup_talloc_pool (struct log_target *target)
int | _log_target_file_setup_iofd (struct log_target *target, int fd)
static void | _gsmtap_raw_output (struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)
static int | logp2syslog_level (unsigned int level)
static void | _syslog_output (struct log_target *target, unsigned int level, const char *log)
static void | _systemd_output (struct log_target *target, unsigned int level, const char *log)
static void | _systemd_raw_output (struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap)

## Variables

struct log_info * | osmo_log_info
struct log_info * | osmo_log_info
static struct log_context | log_context
void * | tall_log_ctx = NULL
__thread struct log_thread_state | log_thread_state
static volatile uint8_t * | log_level_lookup_cache
| One global copy that contains the union of log levels for all targets for all categories, used for quick lock free checks of log targets.
static pthread_mutex_t | osmo_log_tgt_mutex
| This mutex must be held while using osmo_log_target_list or any of its log_targets in a multithread program.
static bool | osmo_log_tgt_mutex_on = false
const struct value_string | loglevel_strs []
static const struct log_info_cat | internal_cat [OSMO_NUM_DLIB]
static const struct value_string | level_colors []
static struct osmo_io_ops | log_target_file_io_ops
static __thread uint32_t | logging_gsmtap_tid

## Detailed Description

libosmocore Logging sub-system

## Macro Definition Documentation

## DEBUG

#define DEBUG

## DEBUGP

#define DEBUGP | ( |  | ss,
|  |  | fmt,
|  |  | args... )

Value:
LOGP(ss, LOGL_DEBUG, fmt, ##args)
LOGP
#define LOGP(ss, level, fmt, args...)
Log a new message through the Osmocom logging framework.
Definition logging.h:49
LOGL_DEBUG
#define LOGL_DEBUG
different log levels
Definition logging.h:122

Log a debug message through the Osmocom logging framework.

Parameters

  [in] | ss | logging subsystem (e.g. DLGLOBAL)
  [in] | fmt | format string
  [in] | args | variable argument list

Referenced by rate_ctrl_group_desc_validate().

## DEBUGPC

#define DEBUGPC | ( |  | ss,
|  |  | fmt,
|  |  | args... )

Value:
LOGPC(ss, LOGL_DEBUG, fmt, ##args)
LOGPC
#define LOGPC(ss, level, fmt, args...)
Continue a log message through the Osmocom logging framework.
Definition logging.h:59

## DLBSSGP

#define DLBSSGP -21

Osmocom BSSGP layer.

## DLCSN1

#define DLCSN1 -26

CSN.1 (Concrete Syntax Notation 1) codec.

## DLCTRL

#define DLCTRL -8

Control Interface.

## DLGLOBAL

#define DLGLOBAL -1

global logging

Referenced by _msgb_eq(), _osmo_fsm_inst_dispatch(), log_target_file_switch_to_stream(), mangle_identifier_ifneeded(), map_subsys(), msgb_alloc_c(), msgb_copy_resize_c(), netdev_netns_ctx_init(), osmo_close_all_fds_above(), osmo_fsm_inst_update_id_f(), osmo_fsm_register(), osmo_mnl_fd_cb(), osmo_mnl_init(), osmo_system_nowait2(), osmo_tundev_open(), osmo_wqueue_enqueue(), rate_ctr_group_alloc(), rate_ctr_group_desc_mangle(), rate_ctr_init(), rate_ctr_timer_cb(), and rate_ctrl_group_desc_validate().

## DLGSUP

#define DLGSUP -11

Generic Subscriber Update Protocol.

## DLGTP

#define DLGTP -9

GTP (GPRS Tunneling Protocol.

## DLINP

#define DLINP -3

(A-bis) Input sub-system

## DLIO

#define DLIO -29

Osmocom IO sub-system.

Referenced by osmo_iofd_setup().

## DLIUUP

#define DLIUUP -24

Osmocom IuUP layer.

## DLJIBUF

#define DLJIBUF -18

Osmocom Jitter Buffer.

## DLLAPD

#define DLLAPD -2

LAPD implementation.

## DLM2PA

#define DLM2PA -27

Osmocom M2PA (libosmo-sigtran).

## DLM2UA

#define DLM2UA -28

Reserved for future Osmocom M2UA (libosmo-sigtran).

## DLM3UA

#define DLM3UA -16

Osmocom M3UA.

## DLMGCP

#define DLMGCP -17

Osmocom MGCP.

## DLMI

#define DLMI -5

ISDN-layer below input sub-system.

## DLMIB

#define DLMIB -6

ISDN layer B-channel.

## DLMUX

#define DLMUX -4

Osmocom Multiplex (Osmux).

## DLNS

#define DLNS -20

Osmocom NS layer.

## DLNSDATA

#define DLNSDATA -22

Osmocom NS layer data pdus.

## DLNSSIGNAL

#define DLNSSIGNAL -23

Osmocom NS layer signal pdus.

## DLOAP

#define DLOAP -12

Osmocom Authentication Protocol.

## DLPFCP

#define DLPFCP -25

Osmocom Packet Forwarding Control Protocol.

## DLRSPRO

#define DLRSPRO -19

Osmocom Remote SIM Protocol.

## DLSCCP

#define DLSCCP -14

Osmocom SCCP.

## DLSMS

#define DLSMS -7

SMS sub-system.

## DLSS7

#define DLSS7 -13

Osmocom SS7.

## DLSTATS

#define DLSTATS -10

Statistics.

Referenced by osmo_stats_reporter_log_send(), osmo_stats_timer_cb(), and start_timer().

## DLSUA

#define DLSUA -15

Osmocom SUA.

## DLTCAP

#define DLTCAP -30

Osmocom TCAP.

## GPRS_CTX_BVC

#define GPRS_CTX_BVC LOG_CTX_GB_BVC

Compatibility with older libosmocore versions.

## GPRS_CTX_NSVC

#define GPRS_CTX_NSVC LOG_CTX_GB_NSVC

Compatibility with older libosmocore versions.

## GSMTAP_MSG_MAX_SIZE

#define GSMTAP_MSG_MAX_SIZE

Value:
(sizeof(struct gsmtap_hdr) + \
sizeof(struct gsmtap_osmocore_log_hdr) + \
MAX_LOG_SIZE)
MAX_LOG_SIZE
#define MAX_LOG_SIZE
Definition logging_internal.h:12
gsmtap_hdr
Structure of the GSMTAP pseudo-header.
Definition gsmtap.h:305
gsmtap_osmocore_log_hdr
Structure of the GSMTAP libosmocore logging header.
Definition gsmtap.h:325

Referenced by _gsmtap_raw_output(), and log_target_create_gsmtap().

## INT2IDX

#define INT2IDX | ( |  | x | ) |

Value:
(-1*(x)-1)
x
uint32_t x
Definition jhash.h:0

## LOG_FILTER_ALL

#define LOG_FILTER_ALL (1<<LOG_FLT_ALL)

Compatibility with older libosmocore versions.

## LOG_MAX_CTX

#define LOG_MAX_CTX _LOG_CTX_COUNT

Maximum number of logging contexts.

Referenced by log_get_context(), log_set_context(), and log_context::OSMO_DEPRECATED_OUTSIDE().

## LOG_MAX_FILTERS

#define LOG_MAX_FILTERS _LOG_FLT_COUNT

Maximum number of logging filters.

Referenced by log_get_filter(), log_get_filter_data(), log_set_filter(), and log_set_filter_data().

## LOG_MTX_DEBUG

#define LOG_MTX_DEBUG 0

## log_tgt_mutex_lock

#define log_tgt_mutex_lock | ( |  | ) |

Value:
log_tgt_mutex_lock_impl()
log_tgt_mutex_lock_impl
void log_tgt_mutex_lock_impl(void)
Acquire the osmo_log_tgt_mutex.
Definition logging.c:185

Referenced by log_cache_enable(), log_check_level(), log_fini(), log_targets_reopen(), and osmo_vlogp().

## log_tgt_mutex_unlock

#define log_tgt_mutex_unlock | ( |  | ) |

Value:
log_tgt_mutex_unlock_impl()
log_tgt_mutex_unlock_impl
void log_tgt_mutex_unlock_impl(void)
Release the osmo_log_tgt_mutex.
Definition logging.c:201

Referenced by log_cache_enable(), log_check_level(), log_fini(), log_targets_reopen(), and osmo_vlogp().

## LOGL_DEBUG

#define LOGL_DEBUG 1

different log levels

debugging information

Referenced by logp().

## LOGL_ERROR

#define LOGL_ERROR 7

error condition, requires user action

Referenced by _osmo_fsm_inst_dispatch(), _osmo_fsm_inst_term_children(), iofd_handle_segmentation(), iofd_handle_segmented_read(), iofd_poll_ofd_cb_recvmsg_sendmsg(), iofd_txqueue_enqueue(), logp2syslog_level(), logp2syslog_level(), msgb_copy_resize_c(), netdev_netns_ctx_init(), osmo_close_all_fds_above(), osmo_fsm_inst_update_id_f(), osmo_fsm_register(), osmo_iofd_register(), osmo_iofd_sendmsg_msgb(), osmo_iofd_sendto_msgb(), osmo_iofd_set_ioops(), osmo_iofd_setup(), osmo_iofd_write_msgb(), osmo_mnl_fd_cb(), osmo_mnl_init(), osmo_netdev_add_addr(), osmo_netdev_add_route(), osmo_netdev_del_addr(), osmo_netdev_ifupdown(), osmo_netdev_set_mtu(), osmo_system_nowait2(), osmo_tundev_open(), osmo_tundev_send(), osmo_wqueue_enqueue(), rate_ctr_group_alloc(), rate_ctr_group_desc_mangle(), rate_ctr_init(), rate_ctrl_group_desc_validate(), start_timer(), state_chg(), tundev_decaps(), and tundev_write_cb().

## LOGL_FATAL

#define LOGL_FATAL 8

fatal, program aborted

Referenced by _msgb_eq(), level_color(), logp2syslog_level(), logp2syslog_level(), and msgb_alloc_c().

## LOGL_INFO

#define LOGL_INFO 3

general information

Referenced by logp2syslog_level(), logp2syslog_level(), netdev_netns_ctx_init(), osmo_stats_reporter_log_send(), osmo_tundev_open(), rate_ctr_group_desc_mangle(), and start_timer().

## LOGL_NOTICE

#define LOGL_NOTICE 5

abnormal/unexpected condition

Referenced by log_init(), log_target_file_switch_to_stream(), logp2syslog_level(), logp2syslog_level(), mangle_identifier_ifneeded(), osmo_netdev_add_addr(), osmo_netdev_add_route(), osmo_netdev_del_addr(), osmo_netdev_ifupdown(), osmo_netdev_set_mtu(), osmo_stats_timer_cb(), rate_ctr_timer_cb(), tundev_dev_name_chg_cb(), tundev_ifupdown_ind_cb(), and tundev_mtu_chg_cb().

## LOGP

#define LOGP | ( |  | ss,
|  |  | level,
|  |  | fmt,
|  |  | args... )

Value:
LOGPSRC(ss, level, NULL, 0, fmt, ## args)
LOGPSRC
#define LOGPSRC(ss, level, caller_file, caller_line, fmt, args...)
Log through the Osmocom logging framework with explicit source.
Definition logging.h:84
level
uint8_t level
logging level
Definition gsmtap.h:6

Log a new message through the Osmocom logging framework.

Parameters

  [in] | ss | logging subsystem (e.g. DLGLOBAL)
  [in] | level | logging level (e.g. LOGL_NOTICE)
  [in] | fmt | format string
  [in] | args | variable argument list

Referenced by log_target_file_switch_to_stream(), mangle_identifier_ifneeded(), msgb_alloc_c(), msgb_copy_resize_c(), netdev_netns_ctx_init(), osmo_close_all_fds_above(), osmo_fsm_inst_update_id_f(), osmo_fsm_register(), osmo_iofd_setup(), osmo_log_backtrace(), osmo_mnl_fd_cb(), osmo_mnl_init(), osmo_stats_reporter_log_send(), osmo_stats_timer_cb(), osmo_system_nowait2(), osmo_tundev_open(), osmo_wqueue_enqueue(), rate_ctr_group_alloc(), rate_ctr_group_desc_mangle(), rate_ctr_init(), rate_ctr_timer_cb(), rate_ctrl_group_desc_validate(), and start_timer().

## LOGPC

#define LOGPC | ( |  | ss,
|  |  | level,
|  |  | fmt,
|  |  | args... )

Value:
do { \
if (!osmo_log_info) { \
logp_stub(__FILE__, __LINE__, 1, fmt, ##args); \
break; \
} \
if (log_check_level(ss, level)) \
logp2(ss, level, __FILE__, __LINE__, 1, fmt, ##args); \
} while(0)
log_check_level
int log_check_level(int subsys, unsigned int level)
Check whether a log entry will be generated.
Definition logging.c:1386
osmo_log_info
struct log_info * osmo_log_info
Definition logging.c:81

Continue a log message through the Osmocom logging framework.

Parameters

  [in] | ss | logging subsystem (e.g. DLGLOBAL)
  [in] | level | logging level (e.g. LOGL_NOTICE)
  [in] | fmt | format string
  [in] | args | variable argument list

Referenced by _msgb_eq().

## LOGPSRC

#define LOGPSRC | ( |  | ss,
|  |  | level,
|  |  | caller_file,
|  |  | caller_line,
|  |  | fmt,
|  |  | args... )

Value:
LOGPSRCC(ss, level, caller_file, caller_line, 0, fmt, ##args)
LOGPSRCC
#define LOGPSRCC(ss, level, caller_file, caller_line, cont, fmt, args...)
Log through the Osmocom logging framework with explicit source.
Definition logging.h:101

Log through the Osmocom logging framework with explicit source.

If caller_file is passed as NULL, FILE and LINE are used instead of caller_file and caller_line (so that this macro here defines both cases in the same place, and to catch cases where callers fail to pass a non-null filename string).

Parameters

  [in] | ss | logging subsystem (e.g. DLGLOBAL)
  [in] | level | logging level (e.g. LOGL_NOTICE)
  [in] | caller_file | caller's source file string (e.g. FILE)
  [in] | caller_line | caller's source line nr (e.g. LINE)
  [in] | fmt | format string
  [in] | args | variable argument list

Referenced by _msgb_eq(), and _osmo_fsm_inst_dispatch().

## LOGPSRCC

#define LOGPSRCC | ( |  | ss,
|  |  | level,
|  |  | caller_file,
|  |  | caller_line,
|  |  | cont,
|  |  | fmt,
|  |  | args... )

Value:
do { \
if (!osmo_log_info) { \
if (caller_file) \
logp_stub(caller_file, caller_line, cont, fmt, ##args); \
else \
logp_stub(__FILE__, __LINE__, cont, fmt, ##args); \
break; \
} \
if (log_check_level(ss, level)) {\
if (caller_file) \
logp2(ss, level, caller_file, caller_line, cont, fmt, ##args); \
else \
logp2(ss, level, __FILE__, __LINE__, cont, fmt, ##args); \
}\
} while(0)

Log through the Osmocom logging framework with explicit source.

If caller_file is passed as NULL, FILE and LINE are used instead of caller_file and caller_line (so that this macro here defines both cases in the same place, and to catch cases where callers fail to pass a non-null filename string).

Parameters

  [in] | ss | logging subsystem (e.g. DLGLOBAL)
  [in] | level | logging level (e.g. LOGL_NOTICE)
  [in] | caller_file | caller's source file string (e.g. FILE)
  [in] | caller_line | caller's source line nr (e.g. LINE)
  [in] | cont | continuation (1) or new line (0)
  [in] | fmt | format string
  [in] | args | variable argument list

## OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET

#define OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE_LOG_TARGET OSMO_DEPRECATED_OUTSIDE("Accessing struct log_target members directly is deprecated")

structure representing a logging target

## OSMO_LOGCOLOR_BLUE

#define OSMO_LOGCOLOR_BLUE "\033[1;34m"

## OSMO_LOGCOLOR_BRIGHTWHITE

#define OSMO_LOGCOLOR_BRIGHTWHITE "\033[1;37m"

## OSMO_LOGCOLOR_CYAN

#define OSMO_LOGCOLOR_CYAN "\033[1;36m"

## OSMO_LOGCOLOR_DARKBLUE

#define OSMO_LOGCOLOR_DARKBLUE "\033[34m"

## OSMO_LOGCOLOR_DARKCYAN

#define OSMO_LOGCOLOR_DARKCYAN "\033[36m"

## OSMO_LOGCOLOR_DARKGREEN

#define OSMO_LOGCOLOR_DARKGREEN "\033[32m"

## OSMO_LOGCOLOR_DARKGREY

#define OSMO_LOGCOLOR_DARKGREY "\033[1;30m"

## OSMO_LOGCOLOR_DARKPURPLE

#define OSMO_LOGCOLOR_DARKPURPLE "\033[35m"

## OSMO_LOGCOLOR_DARKRED

#define OSMO_LOGCOLOR_DARKRED "\033[31m"

## OSMO_LOGCOLOR_DARKYELLOW

#define OSMO_LOGCOLOR_DARKYELLOW "\033[33m"

## OSMO_LOGCOLOR_END

#define OSMO_LOGCOLOR_END "\033[0;m"

Referenced by log_output_buf().

## OSMO_LOGCOLOR_GREEN

#define OSMO_LOGCOLOR_GREEN "\033[1;32m"

## OSMO_LOGCOLOR_GREY

#define OSMO_LOGCOLOR_GREY "\033[37m"

## OSMO_LOGCOLOR_NORMAL

#define OSMO_LOGCOLOR_NORMAL NULL

## OSMO_LOGCOLOR_PURPLE

#define OSMO_LOGCOLOR_PURPLE "\033[1;35m"

## OSMO_LOGCOLOR_RED

#define OSMO_LOGCOLOR_RED "\033[1;31m"

## OSMO_LOGCOLOR_YELLOW

#define OSMO_LOGCOLOR_YELLOW "\033[1;33m"

## OSMO_NUM_DLIB

#define OSMO_NUM_DLIB 30

Number of logging sub-systems in libraries.

## SD_JOURNAL_SUPPRESS_LOCATION

#define SD_JOURNAL_SUPPRESS_LOCATION

## TRACE

#define TRACE | ( |  | probe | ) |

Referenced by logp2().

## TRACE_ENABLED

#define TRACE_ENABLED | ( |  | probe | ) |

Value:
(0)

## Typedef Documentation

## log_filter

typedef int log_filter(const struct log_context *ctx, struct log_target *target)

Log filter function.

## log_print_filters

typedef void log_print_filters(struct vty *vty, const struct log_info *info, const struct log_target *tgt)

## log_save_filters

typedef void log_save_filters(struct vty *vty, const struct log_info *info, const struct log_target *tgt)

## Enumeration Type Documentation

## log_ctx_index

enum log_ctx_index

Indexes to indicate the object currently acted upon.

Array indexes for the global log_context array.

Enumerator
LOG_CTX_GB_NSVC |
LOG_CTX_GB_BVC |
LOG_CTX_BSC_SUBSCR |
LOG_CTX_VLR_SUBSCR |
LOG_CTX_L1_SAPI |
LOG_CTX_GB_NSE |
_LOG_CTX_COUNT |

## log_filename_pos

enum log_filename_pos

Where on a log line source file and line should be logged.

Enumerator
LOG_FILENAME_POS_HEADER_END |
LOG_FILENAME_POS_LINE_END |

## log_filename_type

enum log_filename_type

Whether/how to log the source filename (and line number).

Enumerator
LOG_FILENAME_NONE |
LOG_FILENAME_PATH |
LOG_FILENAME_BASENAME |

## log_filter_index

enum log_filter_index

Indexes to indicate objects that should be logged.

Array indexes to log_target->filter_data and bit indexes for log_target->filter_map.

Enumerator
LOG_FLT_ALL |
LOG_FLT_GB_NSVC |
LOG_FLT_GB_BVC |
LOG_FLT_BSC_SUBSCR |
LOG_FLT_VLR_SUBSCR |
LOG_FLT_L1_SAPI |
LOG_FLT_GB_NSE |
_LOG_FLT_COUNT |

## log_target_type

enum log_target_type

Type of logging target.

Enumerator
LOG_TGT_TYPE_VTY | VTY logging.
LOG_TGT_TYPE_SYSLOG | syslog based logging
LOG_TGT_TYPE_FILE | text file logging
LOG_TGT_TYPE_STDERR | stderr logging
LOG_TGT_TYPE_STRRB | osmo_strrb-backed logging
LOG_TGT_TYPE_GSMTAP | GSMTAP network logging.
LOG_TGT_TYPE_SYSTEMD | systemd journal logging
LOG_TGT_TYPE_EMSCRIPTEN | Emscripten logging using JS callback.

## Function Documentation

## _emscripten_raw_output()

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

static

References level, log_category_name(), MAX_LOG_SIZE, and subsys.

Referenced by log_target_create_emscripten().

## _file_output_stream()

void _file_output_stream | ( | struct log_target * | target,
|  | unsigned int | level,
|  | const char * | log )

static

References level, OSMO_ASSERT, log_target::out, and log_target::tgt_file.

Referenced by log_target_create_file(), log_target_create_stderr(), and log_target_file_switch_to_stream().

## _file_raw_output()

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

static

References osmo_wqueue::except_cb, level, log_output_buf(), MAX_LOG_SIZE, msgb_alloc_c(), msgb_data(), msgb_free(), msgb_put(), msgb_tailroom(), OSMO_ASSERT, osmo_iofd_get_data(), osmo_iofd_write_msgb(), subsys, log_target::tgt_file, and log_target::wqueue.

Referenced by log_target_file_switch_to_wqueue().

## _gsmtap_raw_output()

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

static

References log_target::gsmtap_inst, GSMTAP_MSG_MAX_SIZE, gsmtap_sendmsg(), GSMTAP_TYPE_OSMOCORE_LOG, GSMTAP_VERSION, gsmtap_hdr::hdr_len, log_target::ident, gsmtap_osmocore_log_hdr::level, level, gsmtap_osmocore_log_hdr::line_nr, log_category_name(), logging_gsmtap_tid, log_target::loglevel, msgb_alloc_c(), msgb_free(), msgb_put(), msgb_tailroom(), gsmtap_osmocore_log_hdr::name, osmo_gettid(), osmo_gettimeofday(), osmo_htonl, osmo_store32be(), OSMO_STRLCPY_ARRAY, log_target::output, gsmtap_osmocore_log_hdr::pid, gsmtap_osmocore_log_hdr::proc_name, gsmtap_osmocore_log_hdr::sec, gsmtap_osmocore_log_hdr::src_file, gsmtap_osmocore_log_hdr::subsys, subsys, log_target::tgt_gsmtap, gsmtap_osmocore_log_hdr::ts, gsmtap_hdr::type, gsmtap_osmocore_log_hdr::usec, and gsmtap_hdr::version.

Referenced by log_target_create_gsmtap().

## _log_target_file_setup_iofd()

int _log_target_file_setup_iofd | ( | struct log_target * | target,
|  | int | fd )

References _log_target_file_setup_talloc_pool(), osmo_wqueue::bfd, osmo_wqueue::except_cb, osmo_fd::fd, osmo_io_fd::fd, log_target::fname, log_target_file_io_ops, LOG_WQUEUE_LEN, OSMO_ASSERT, OSMO_IO_FD_MODE_READ_WRITE, OSMO_IO_OP_WRITE, osmo_iofd_free(), osmo_iofd_get_txqueue_max_length(), osmo_iofd_register(), osmo_iofd_set_io_buffers(), osmo_iofd_set_txqueue_max_length(), osmo_iofd_setup(), OSMO_MAX, OSMO_MIN, osmo_wqueue_init(), log_target::tgt_file, and log_target::wqueue.

Referenced by log_target_file_switch_to_wqueue().

## _log_target_file_setup_talloc_pool()

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

References osmo_wqueue::except_cb, LOG_WQUEUE_LEN, MAX_LOG_SIZE, OSMO_ASSERT, osmo_iofd_get_data(), osmo_iofd_set_data(), tall_msgb_ctx, log_target::tgt_file, and log_target::wqueue.

Referenced by _log_target_file_setup_iofd().

## _syslog_output()

void _syslog_output | ( | struct log_target * | target,
|  | unsigned int | level,
|  | const char * | log )

static

References level, and logp2syslog_level().

Referenced by log_target_create_syslog().

## _systemd_output()

void _systemd_output | ( | struct log_target * | target,
|  | unsigned int | level,
|  | const char * | log )

static

References level, and logp2syslog_level().

Referenced by log_target_systemd_set_raw().

## _systemd_raw_output()

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

static

References level, log_category_name(), logp2syslog_level(), and subsys.

Referenced by log_target_systemd_set_raw().

## 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().

## color()

const char * color | ( | int | subsys | ) |

static

References osmo_log_info, and subsys.

Referenced by log_output_buf(), rb_erase(), and rb_set_color().

## const_basename()

const char * const_basename | ( | const char * | path | ) |

static

Referenced by log_output_buf().

## EM_JS()

EM_JS | ( | void | ,
|  | on_log_wrapper | ,
|  | (const char *subsys, int level, const char *msg) | ,
|  | { return on_log(subsys, level, msg);} | )

References level, and subsys.

## level_color()

const char * level_color | ( | int | level | ) |

static

References get_value_string(), get_value_string_or_null(), level, level_colors, and LOGL_FATAL.

Referenced by log_output_buf().

## LLIST_HEAD()

LLIST_HEAD | ( | osmo_log_target_list |  | ) |

References osmo_log_target_list.

## log_add_target()

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

Register a new log target with the logging core.

Parameters

  [in] | target | Log target to be registered

References log_target::entry, llist_add_tail(), log_cache_update_all(), and osmo_log_target_list.

Referenced by osmo_init_logging2().

## log_cache_check()

bool log_cache_check | ( | int | mapped_subsys,
|  | int | level )

static

Queries log level cache.

Parameters

  [in] | mapped_subsys | plain category index (after mapping)
  [in] | level | log level

Returns
  true if logging should happen for at least one log target

References level, and log_level_lookup_cache.

Referenced by log_check_level(), and osmo_vlogp().

## log_cache_enable()

int log_cache_enable | ( | void |  | ) |

Enable the log level lookup cache to bypass string formatting and other code for log statements which are not actually enabled/needed by any existing log target.

\retruns 0 in case of success, negative -errno in case of error.

References log_cache_update_all(), log_level_lookup_cache, log_tgt_mutex_lock, log_tgt_mutex_unlock, and osmo_log_info.

## log_cache_update()

void log_cache_update | ( | int | mapped_subsys,
|  | uint8_t | enabled,
|  | uint8_t | level )

Updates single cache entry, caller must hold osmo_log_tgt_mutex.

Parameters

  [in] | mapped_subsys | plain category index (after mapping)
  [in] | enabled | log category enabled?
  [in] | level | log level

References log_target::categories, log_category::enabled, level, llist_for_each_entry, log_level_lookup_cache, log_category::loglevel, log_target::loglevel, osmo_log_target_list, OSMO_MAX, and OSMO_MIN.

Referenced by log_set_category_filter(), and log_target_create().

## log_cache_update_all()

void log_cache_update_all | ( | void |  | ) |

static

Updates cache for all targets for all categies, caller must hold osmo_log_tgt_mutex.

References log_target::categories, log_category::enabled, log_target::entry, llist_for_each_entry, log_level_lookup_cache, log_category::loglevel, log_target::loglevel, osmo_log_info, osmo_log_target_list, OSMO_MAX, and OSMO_MIN.

Referenced by log_add_target(), log_cache_enable(), log_del_target(), log_parse_category_mask(), and log_set_log_level().

## log_category_name()

const char * log_category_name | ( | int | subsys | ) |

References osmo_log_info, and subsys.

Referenced by _emscripten_raw_output(), _gsmtap_raw_output(), _systemd_raw_output(), and log_output_buf().

## log_check_level()

int log_check_level | ( | int | subsys,
|  | unsigned int | level )

Check whether a log entry will be generated.

Returns
  != 0 if a log entry might get generated by at least one target

References assert_loginfo(), log_target::entry, level, llist_for_each_entry, log_cache_check(), log_tgt_mutex_lock, log_tgt_mutex_unlock, log_thread_state::logging_active, map_subsys(), osmo_log_target_list, OSMO_UNLIKELY, should_log_to_target(), and subsys.

## log_del_target()

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

Unregister a log target from the logging core.

Parameters

  [in] | target | Log target to be unregistered

References log_target::entry, llist_del(), and log_cache_update_all().

Referenced by log_target_destroy().

## log_enable_multithread()

void log_enable_multithread | ( | void |  | ) |

Enable multithread support (mutex) in libosmocore logging system.

Must be called by processes willing to use logging subsystem from several threads. Once enabled, it's not possible to disable it again.

References osmo_log_tgt_mutex, and osmo_log_tgt_mutex_on.

## log_fini()

void log_fini | ( | void |  | ) |

References log_target::entry, llist_for_each_entry_safe, log_target_destroy(), log_tgt_mutex_lock, log_tgt_mutex_unlock, osmo_log_info, osmo_log_target_list, and tall_log_ctx.

## log_get_context()

void * log_get_context | ( | const struct log_context * | ctx,
|  | uint8_t | ctx_nr )

Get the logging context.

Parameters

  [in] | ctx | logging context
  [in] | ctx_nr | logging context number

Returns
  value set for the context

A logging context is something like the subscriber identity to which the currently processed message relates, or the BTS through which it was received. The main use of this API is during (struct log_info)->filter_fn(ctx, log_tgt).

References LOG_MAX_CTX.

## log_get_filter()

bool log_get_filter | ( | const struct log_target * | target,
|  | int | log_filter_index )

Query whether a log filter is enabled or disabled.

Parameters

  [in] | target | Log target to be queried
  [in] | log_filter_index | the index of the log filter to query

Returns
  whether the filtering is enabled (true) or disabled (false)

References LOG_MAX_FILTERS.

## log_get_filter_data()

void * log_get_filter_data | ( | const struct log_target * | target,
|  | int | log_filter_index )

Obtain data associated to a log filter.

Parameters

  [in] | target | Log target to be queried
  [in] | log_filter_index | the index of the log filter to query

Returns
  data associated to the log filter

References LOG_MAX_FILTERS.

## log_init()

int log_init | ( | const struct log_info * | inf,
|  | void * | ctx )

Initialize the Osmocom logging core.

Parameters

  [in] | inf | Information regarding logging categories, could be NULL
  [in] | ctx | talloc context for logging allocations

Returns
  0 in case of success, negative in case of error

If inf is NULL then only library-internal categories are initialized.

References ARRAY_SIZE, log_info::cat, log_info::filter_fn, internal_cat, LOGL_NOTICE, log_info_cat::loglevel, log_info::num_cat, OSMO_ASSERT, osmo_log_info, and tall_log_ctx.

Referenced by osmo_init_logging2().

## log_level_str()

const char * log_level_str | ( | unsigned int | lvl | ) |

convert a numeric log level into human-readable string

Parameters

  [in] | lvl | numeric log level

Returns
  zero-terminated string (log level name)

References get_value_string(), and loglevel_strs.

Referenced by log_output_buf().

## 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(), 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, and log_target::use_color.

Referenced by _file_raw_output(), and osmo_vlogp().

## log_parse_category()

int log_parse_category | ( | const char * | category | ) |

parse a human-readable log category into numeric form

Parameters

  [in] | category | human-readable log category name

Returns
  numeric category value, or -EINVAL otherwise

References assert_loginfo(), and osmo_log_info.

## log_parse_category_mask()

void log_parse_category_mask | ( | struct log_target * | target,
|  | const char * | _mask )

parse the log category mask

Parameters

  [in] | target | log target to be configured
  [in] | _mask | log category mask string

The format can be this: category1:category2:category3 or category1,2:category2,3:...

References assert_loginfo(), log_target::categories, log_category::enabled, level, log_cache_update_all(), log_category::loglevel, OSMO_ASSERT, and osmo_log_info.

## log_parse_level()

int log_parse_level | ( | const char * | lvl | ) |

Parse a human-readable log level into a numeric value.

Parameters

  [in] | lvl | zero-terminated string containing log level name

Returns
  numeric log level

References get_string_value(), and loglevel_strs.

## log_reset_context()

void log_reset_context | ( | void |  | ) |

Reset (clear) the logging context.

## log_set_all_filter()

void log_set_all_filter | ( | struct log_target * | target,
|  | int | all )

Enable/disable the LOG_FLT_ALL log filter.

Parameters

  [in] | target | Log target to be affected
  [in] | all | enable (1) or disable (0) the ALL filter

When the LOG_FLT_ALL filter is enabled, all log messages will be printed. It acts as a wildcard. Setting it to 1 means there is no filtering.

References LOG_FLT_ALL.

Referenced by osmo_init_logging2().

## log_set_category_filter()

void log_set_category_filter | ( | struct log_target * | target,
|  | int | category,
|  | int | enable,
|  | int | level )

Set a category filter on a given log target.

Parameters

  [in] | target | Log target to be affected
  [in] | category | Log category to be affected
  [in] | enable | whether to enable or disable the filter
  [in] | level | Log level of the filter

References log_target::categories, log_category::enabled, level, log_cache_update(), log_category::loglevel, and map_subsys().

## log_set_context()

int log_set_context | ( | uint8_t | ctx_nr,
|  | void * | value )

Set the logging context.

Parameters

  [in] | ctx_nr | logging context number
  [in] | value | value to which the context is to be set

Returns
  0 in case of success; negative otherwise

A logging context is something like the subscriber identity to which the currently processed message relates, or the BTS through which it was received. As soon as this data is known, it can be set using this function. The main use of context information is for logging filters.

References LOG_MAX_CTX.

## log_set_filter()

int log_set_filter | ( | struct log_target * | target,
|  | int | log_filter_index,
|  | bool | enable )

Enable/disable a log filter.

Parameters

  [in] | target | Log target to be affected
  [in] | log_filter_index | the index of the log filter to set
  [in] | enable | enable (true) or disable (false) the ALL filter

Returns
  0 on success, negative on error.

References LOG_MAX_FILTERS.

## log_set_filter_data()

int log_set_filter_data | ( | struct log_target * | target,
|  | int | log_filter_index,
|  | void * | data )

Set data associated to a log filter.

Parameters

  [in] | target | Log target to be affected
  [in] | log_filter_index | the index of the log filter to set associate data for
  [in] | data | The user provided data pointer to associate to the log filter

Returns
  0 on success, negative on error.

References LOG_MAX_FILTERS.

## log_set_log_level()

void log_set_log_level | ( | struct log_target * | target,
|  | int | log_level )

Set the global log level for a given log target.

Parameters

  [in] | target | Log target to be affected
  [in] | log_level | New global log level

References log_cache_update_all(), and log_target::loglevel.

## log_set_print_category()

void log_set_print_category | ( | struct log_target * | target,
|  | int | print_category )

Enable or disable printing of the category name.

Parameters

  [in] | target | Log target to be affected
  [in] | print_category | Enable (1) or disable (0) filenames

Print the category/subsys name in front of every log message.

References log_target::print_category.

## log_set_print_category_hex()

void log_set_print_category_hex | ( | struct log_target * | target,
|  | int | print_category_hex )

Enable or disable printing of the category number in hex ('<000b>').

Parameters

  [in] | target | Log target to be affected.
  [in] | print_category_hex | Enable (1) or disable (0) hex category.

References log_target::print_category_hex.

Referenced by log_set_print_filename().

## log_set_print_extended_timestamp()

void log_set_print_extended_timestamp | ( | struct log_target * | target,
|  | int | print_timestamp )

Enable or disable printing of extended timestamps while logging.

Parameters

  [in] | target | Log target to be affected
  [in] | print_timestamp | Enable (1) or disable (0) timestamps

When both timestamp and extended timestamp is enabled then only the extended timestamp will be used. The format of the timestamp is YYYYMMDDhhmmssnnn.

References log_target::print_ext_timestamp, and log_target::print_timestamp.

## log_set_print_filename()

void log_set_print_filename | ( | struct log_target * | target,
|  | int | print_filename )

Use log_set_print_filename2() instead.

Call log_set_print_filename2() with LOG_FILENAME_PATH or LOG_FILENAME_NONE, as well as call log_set_print_category_hex() with the argument passed to this function. This is to mirror legacy behavior, which combined the category in hex with the filename. For example, if the category-hex output were no longer affected by log_set_print_filename(), many unit tests (in libosmocore as well as dependent projects) would fail since they expect the category to disappear along with the filename.

Parameters

  [in] | target | Log target to be affected
  [in] | print_filename | Enable (1) or disable (0) filenames

References LOG_FILENAME_NONE, LOG_FILENAME_PATH, log_set_print_category_hex(), log_set_print_filename2(), and log_target::print_filename.

## log_set_print_filename2()

void log_set_print_filename2 | ( | struct log_target * | target,
|  | enum log_filename_type | lft )

Enable or disable printing of the filename while logging.

Parameters

  [in] | target | Log target to be affected.
  [in] | lft | An LOG_FILENAME_* enum value. LOG_FILENAME_NONE omits the source file and line information from logs. LOG_FILENAME_PATH prints the entire source file path as passed to LOGP macros.

References log_target::print_filename2.

Referenced by log_set_print_filename().

## log_set_print_filename_pos()

void log_set_print_filename_pos | ( | struct log_target * | target,
|  | enum log_filename_pos | pos )

Set the position where on a log line the source file info should be logged.

Parameters

  [in] | target | Log target to be affected.
  [in] | pos | A LOG_FILENAME_POS_* enum value. LOG_FILENAME_POS_DEFAULT logs just before the caller supplied log message. LOG_FILENAME_POS_LAST logs only at the end of a log line, where the caller issued an ' ' to end the

References log_target::print_filename_pos.

## log_set_print_level()

void log_set_print_level | ( | struct log_target * | target,
|  | int | print_level )

Enable or disable printing of the log level name.

Parameters

  [in] | target | Log target to be affected
  [in] | print_level | Enable (1) or disable (0) log level name

Print the log level name in front of every log message.

References log_target::print_level.

## log_set_print_tid()

void log_set_print_tid | ( | struct log_target * | target,
|  | int | print_tid )

Enable or disable printing of timestamps while logging.

Parameters

  [in] | target | Log target to be affected
  [in] | print_tid | Enable (1) or disable (0) Thread ID logging

References log_target::print_tid.

## log_set_print_timestamp()

void log_set_print_timestamp | ( | struct log_target * | target,
|  | int | print_timestamp )

Enable or disable printing of timestamps while logging.

Parameters

  [in] | target | Log target to be affected
  [in] | print_timestamp | Enable (1) or disable (0) timestamps

References log_target::print_timestamp.

## log_set_use_color()

void log_set_use_color | ( | struct log_target * | target,
|  | int | use_color )

Enable or disable the use of colored output.

Parameters

  [in] | target | Log target to be affected
  [in] | use_color | Use color (1) or don't use color (0)

References log_target::use_color.

## log_target_create()

struct log_target * log_target_create | ( | void |  | ) |

Create a new log target skeleton.

Returns
  dynamically-allocated log target This funcition allocates a log_target and initializes it with some default values. The newly created target is not registered yet.

References assert_loginfo(), log_target::categories, log_category::enabled, log_target::entry, INIT_LLIST_HEAD, log_cache_update(), LOG_FILENAME_PATH, log_category::loglevel, log_target::loglevel, osmo_log_info, log_target::print_category_hex, log_target::print_filename2, log_target::print_tid, log_target::print_timestamp, tall_log_ctx, and log_target::use_color.

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(), and log_target_create_systemd().

## log_target_create_emscripten()

struct log_target * log_target_create_emscripten | ( | void |  | ) |

Create a new logging target for JS callback logging (uses on_log).

Returns
  Log target in case of success, NULL in case of error

References _emscripten_raw_output(), log_target_create(), LOG_TGT_TYPE_EMSCRIPTEN, log_target::raw_output, and log_target::type.

## log_target_create_file()

struct log_target * log_target_create_file | ( | const char * | fname | ) |

Create a new file-based log target using a stream.

Parameters

  [in] | fname | File name of the new log file

Returns
  Log target in case of success, NULL otherwise

References _file_output_stream(), log_target::fname, log_target_create(), log_target_destroy(), LOG_TGT_TYPE_FILE, OSMO_ASSERT, log_target::out, log_target::output, log_target::tgt_file, and log_target::type.

## log_target_create_gsmtap()

struct log_target * log_target_create_gsmtap | ( | const char * | host,
|  | uint16_t | port,
|  | const char * | ident,
|  | bool | ofd_wq_mode,
|  | bool | add_sink )

Create a new logging target for GSMTAP logging.

Parameters

  [in] | host | remote host to send the logs to
  [in] | port | remote port to send the logs to
  [in] | ident | string identifier
  [in] | ofd_wq_mode | register osmo_wqueue (1) or not (0)
  [in] | add_sink | add GSMTAP sink or not

Returns
  Log target in case of success, NULL in case of error

References _gsmtap_raw_output(), log_target::gsmtap_inst, GSMTAP_MSG_MAX_SIZE, gsmtap_source_add_sink(), gsmtap_source_init(), log_target::hostname, log_target::ident, log_target_create(), log_target_destroy(), LOG_TGT_TYPE_GSMTAP, LOG_WQUEUE_LEN, log_target::output, log_target::raw_output, tall_msgb_ctx, log_target::tgt_gsmtap, and log_target::type.

## log_target_create_stderr()

struct log_target * log_target_create_stderr | ( | void |  | ) |

Create the STDERR log target.

Returns
  dynamically-allocated log_target for STDERR

References _file_output_stream(), log_target_create(), LOG_TGT_TYPE_STDERR, log_target::out, log_target::output, log_target::tgt_file, and log_target::type.

Referenced by osmo_init_logging2().

## log_target_create_syslog()

struct log_target * log_target_create_syslog | ( | const char * | ident,
|  | int | option,
|  | int | facility )

Create a new logging target for syslog logging.

Parameters

  [in] | ident | syslog string identifier
  [in] | option | syslog options
  [in] | facility | syslog facility

Returns
  Log target in case of success, NULL in case of error

References _syslog_output(), log_target::facility, log_target::ident, log_target_create(), LOG_TGT_TYPE_SYSLOG, log_target::output, log_target::tgt_syslog, and log_target::type.

## log_target_create_systemd()

struct log_target * log_target_create_systemd | ( | bool | raw | ) |

Create a new logging target for systemd journal logging.

Parameters

  [in] | raw | whether to offload rendering of the meta information (location, category) to systemd-journal.

Returns
  Log target in case of success, NULL in case of error.

References log_target_create(), log_target_systemd_set_raw(), LOG_TGT_TYPE_SYSTEMD, log_target::raw, and log_target::type.

## log_target_destroy()

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

Unregister, close and delete a log target.

Parameters

  [in] | target | log target to unregister, close and delete

References log_target::gsmtap_inst, gsmtap_source_free(), log_del_target(), log_target_file_destroy(), LOG_TGT_TYPE_FILE, LOG_TGT_TYPE_GSMTAP, LOG_TGT_TYPE_STDERR, LOG_TGT_TYPE_SYSLOG, log_target::tgt_gsmtap, and log_target::type.

Referenced by log_fini(), log_target_create_file(), log_target_create_gsmtap(), and log_target_create_rb().

## 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().

## log_target_file_get_nonblock()

int log_target_file_get_nonblock | ( | const struct log_target * | target | ) |

Find whether the log target fd is configured as non-blocking (see sockopt O_NONBLOCK).

Parameters

  [in] | target | log target which we should switch

Returns
  1 if set as non-block; 0 otherwise; negative on error

References osmo_io_fd::fd, log_target::out, and log_target::tgt_file.

Referenced by log_target_file_reopen().

## log_target_file_reopen()

int log_target_file_reopen | ( | struct log_target * | target | ) |

close and re-open a log file (for log file rotation)

Parameters

  [in] | target | log target to re-open

Returns
  0 in case of success; negative otherwise

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

Referenced by log_targets_reopen().

## log_target_file_set_nonblock()

int log_target_file_set_nonblock | ( | struct log_target * | target,
|  | int | on )

Set the log target fd as non-blocking (see sockopt O_NONBLOCK).

Parameters

  [in] | target | log target which we should switch
  [in] | on | set to 1 to set as non-blocking, 0 to set as blocking.

Returns
  0 on success; negative on error

This setting is ignored when target is in wqueue mode.

References osmo_io_fd::fd, log_target::out, and log_target::tgt_file.

Referenced by log_target_file_reopen().

## log_target_file_switch_to_stream()

int log_target_file_switch_to_stream | ( | struct log_target * | target | ) |

switch from non-blocking/write-queue to blocking + buffered stream output

Parameters

  [in] | target | log target which we should switch

Returns
  0 on success; 1 if already switched before; negative on error Must be called with mutex osmo_log_tgt_mutex held, see log_tgt_mutex_lock.

References _file_output_stream(), osmo_wqueue::bfd, DLGLOBAL, osmo_wqueue::except_cb, osmo_fd::fd, log_target::fname, LOG_TGT_TYPE_STDERR, LOGL_NOTICE, LOGP, osmo_iofd_free(), osmo_iofd_txqueue_len(), log_target::out, log_target::output, log_target::raw_output, log_target::tgt_file, log_target::type, and log_target::wqueue.

## log_target_file_switch_to_wqueue()

int log_target_file_switch_to_wqueue | ( | struct log_target * | target | ) |

switch from blocking + buffered file output to non-blocking write-queue based output.

Parameters

  [in] | target | log target which we should switch

Returns
  0 on success; 1 if already switched before; negative on error Must be called with mutex osmo_log_tgt_mutex held, see log_tgt_mutex_lock.

References _file_raw_output(), _log_target_file_setup_iofd(), osmo_fd::fd, log_target::fname, LOG_TGT_TYPE_FILE, log_target::out, log_target::output, log_target::raw_output, log_target::tgt_file, and log_target::type.

## log_target_find()

struct log_target * log_target_find | ( | enum log_target_type | type,
|  | const char * | fname )

Find a registered log target.

Parameters

  [in] | type | Log target type
  [in] | fname | File name

Returns
  Log target (if found), NULL otherwise Must be called with mutex osmo_log_tgt_mutex held, see log_tgt_mutex_lock.

References log_target::entry, log_target::fname, log_target::hostname, llist_for_each_entry, LOG_TGT_TYPE_FILE, LOG_TGT_TYPE_GSMTAP, osmo_log_target_list, log_target::tgt_file, log_target::tgt_gsmtap, and log_target::type.

## log_target_systemd_set_raw()

void log_target_systemd_set_raw | ( | struct log_target * | target,
|  | bool | raw )

Change meta information handling of an existing logging target.

Parameters

  [in] | target | logging target to be modified.
  [in] | raw | whether to offload rendering of the meta information (location, category) to systemd-journal.

References _systemd_output(), _systemd_raw_output(), log_target::output, log_target::raw, log_target::raw_output, and log_target::sd_journal.

Referenced by log_target_create_systemd().

## log_targets_reopen()

int log_targets_reopen | ( | void |  | ) |

close and re-open all log files (for log file rotation)

Returns
  0 in case of success; negative otherwise

References log_target::entry, llist_for_each_entry, log_target_file_reopen(), log_tgt_mutex_lock, log_tgt_mutex_unlock, LOG_TGT_TYPE_FILE, osmo_log_target_list, and log_target::type.

Referenced by sighup_hdlr().

## log_tgt_mutex_lock_impl()

void log_tgt_mutex_lock_impl | ( | void |  | ) |

Acquire the osmo_log_tgt_mutex.

Don't use this function directly, always use macro log_tgt_mutex_lock() instead.

References osmo_log_tgt_mutex, and osmo_log_tgt_mutex_on.

## log_tgt_mutex_unlock_impl()

void log_tgt_mutex_unlock_impl | ( | void |  | ) |

Release the osmo_log_tgt_mutex.

Don't use this function directly, always use macro log_tgt_mutex_unlock() instead.

References osmo_log_tgt_mutex, and osmo_log_tgt_mutex_on.

## logp()

void logp | ( | int | subsys,
|  | const char * | file,
|  | int | line,
|  | int | cont,
|  | const char * | format,
|  |  | ... )

logging function used by DEBUGP() macro

Parameters

  [in] | subsys | Logging sub-system
  [in] | file | name of source code file
  [in] | cont | continuation (1) or new line (0)
  [in] | format | format string

References LOGL_DEBUG, osmo_vlogp(), and subsys.

## logp2()

void logp2 | ( | int | subsys,
|  | unsigned int | level,
|  | const char * | file,
|  | int | line,
|  | int | cont,
|  | const char * | format,
|  |  | ... )

logging function used by LOGP() macro

Parameters

  [in] | subsys | Logging sub-system
  [in] | level | Log level
  [in] | file | name of source code file
  [in] | cont | continuation (1) or new line (0)
  [in] | format | format string

References level, osmo_vlogp(), subsys, and TRACE.

## logp2syslog_level()

int logp2syslog_level | ( | unsigned int | level | ) |

static

References level, LOGL_ERROR, LOGL_FATAL, LOGL_INFO, and LOGL_NOTICE.

Referenced by _syslog_output().

## logp_stub()

void logp_stub | ( | const char * | file,
|  | int | line,
|  | int | cont,
|  | const char * | format,
|  |  | ... )

## map_subsys()

int map_subsys | ( | int | subsys | ) |

inline static

References DLGLOBAL, OSMO_ASSERT, osmo_log_info, subsys, and subsys_lib2index().

Referenced by log_check_level(), log_set_category_filter(), and osmo_vlogp().

## osmo_static_assert() [1/3]

osmo_static_assert | ( | _LOG_CTX_COUNT<= | ARRAY_SIZE((struct log_context *) NULL) ->ctx,
|  | enum_logging_ctx_items_fit_in_struct_log_context | )

References _LOG_CTX_COUNT.

## osmo_static_assert() [2/3]

osmo_static_assert | ( | _LOG_FLT_COUNT<=8 * | sizeof((struct log_target *) NULL) ->filter_map,
|  | enum_logging_filters_fit_in_log_target_filter_map | )

References _LOG_FLT_COUNT.

## osmo_static_assert() [3/3]

osmo_static_assert | ( | _LOG_FLT_COUNT<= | ARRAY_SIZE((struct log_target *) NULL) ->filter_data,
|  | enum_logging_filters_fit_in_log_target_filter_data | )

References _LOG_FLT_COUNT.

## osmo_vlogp()

void osmo_vlogp | ( | int | subsys,
|  | int | level,
|  | const char * | file,
|  | int | line,
|  | int | cont,
|  | const char * | format,
|  | va_list | ap )

vararg version of logging function

Parameters

  [in] | subsys | Logging sub-system
  [in] | level | Log level
  [in] | file | name of source code file
  [in] | cont | continuation (1) or new line (0)
  [in] | format | format string
  [in] | ap | vararg-list containing format string arguments

References log_target::entry, level, llist_for_each_entry, log_cache_check(), log_output_buf(), log_tgt_mutex_lock, log_tgt_mutex_unlock, log_thread_state::logging_active, map_subsys(), MAX_LOG_SIZE, osmo_log_target_list, OSMO_UNLIKELY, log_target::output, log_target::raw_output, should_log_to_target(), and subsys.

Referenced by logp(), and logp2().

## should_log_to_target()

bool should_log_to_target | ( | struct log_target * | tar,
|  | int | subsys,
|  | int | level )

inline static

References log_target::categories, log_category::enabled, level, LOG_FLT_ALL, log_category::loglevel, log_target::loglevel, osmo_log_info, and subsys.

Referenced by log_check_level(), and osmo_vlogp().

## subsys_lib2index()

int subsys_lib2index | ( | int | subsys | ) |

static

References osmo_log_info, and subsys.

Referenced by map_subsys().

## Variable Documentation

## internal_cat

const struct log_info_cat internal_cat[OSMO_NUM_DLIB]

static

Referenced by log_init().

## level_colors

const struct value_string level_colors[]

static

Initial value:
= {
{ LOGL_DEBUG, OSMO_LOGCOLOR_BLUE },
{ LOGL_INFO, OSMO_LOGCOLOR_GREEN },
{ LOGL_NOTICE, OSMO_LOGCOLOR_YELLOW },
{ LOGL_ERROR, OSMO_LOGCOLOR_RED },
{ LOGL_FATAL, OSMO_LOGCOLOR_RED },
{ 0, NULL }
}
LOGL_NOTICE
#define LOGL_NOTICE
abnormal/unexpected condition
Definition logging.h:124
LOGL_FATAL
#define LOGL_FATAL
fatal, program aborted
Definition logging.h:126
LOGL_ERROR
#define LOGL_ERROR
error condition, requires user action
Definition logging.h:125
LOGL_INFO
#define LOGL_INFO
general information
Definition logging.h:123
OSMO_LOGCOLOR_BLUE
#define OSMO_LOGCOLOR_BLUE
Definition logging.h:166
OSMO_LOGCOLOR_RED
#define OSMO_LOGCOLOR_RED
Definition logging.h:163
OSMO_LOGCOLOR_GREEN
#define OSMO_LOGCOLOR_GREEN
Definition logging.h:164
OSMO_LOGCOLOR_YELLOW
#define OSMO_LOGCOLOR_YELLOW
Definition logging.h:165

Referenced by level_color().

## log_context

struct log_context log_context

static

## log_level_lookup_cache

volatile uint8_t* log_level_lookup_cache

static

One global copy that contains the union of log levels for all targets for all categories, used for quick lock free checks of log targets.

Referenced by log_cache_check(), log_cache_enable(), log_cache_update(), and log_cache_update_all().

## log_target_file_io_ops

struct osmo_io_ops log_target_file_io_ops

static

Initial value:
= {
.read_cb = NULL,
.write_cb = NULL,
}

Referenced by _log_target_file_setup_iofd().

## log_thread_state

__thread struct log_thread_state log_thread_state

## logging_gsmtap_tid

__thread uint32_t logging_gsmtap_tid

static

Referenced by _gsmtap_raw_output().

## loglevel_strs

const struct value_string loglevel_strs[]

Initial value:
= {
{ LOGL_DEBUG, "DEBUG" },
{ LOGL_INFO, "INFO" },
{ LOGL_NOTICE, "NOTICE" },
{ LOGL_ERROR, "ERROR" },
{ LOGL_FATAL, "FATAL" },
{ 0, NULL },
}

Referenced by log_level_str(), and log_parse_level().

## osmo_log_info [1/2]

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_info [2/2]

struct log_info* osmo_log_info

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_tgt_mutex

pthread_mutex_t osmo_log_tgt_mutex

static

This mutex must be held while using osmo_log_target_list or any of its log_targets in a multithread program.

Prevents race conditions between threads like producing unordered timestamps or VTY deleting a target while another thread is writing to it

Referenced by log_enable_multithread(), log_tgt_mutex_lock_impl(), and log_tgt_mutex_unlock_impl().

## osmo_log_tgt_mutex_on

bool osmo_log_tgt_mutex_on = false

static

Referenced by log_enable_multithread(), log_tgt_mutex_lock_impl(), and log_tgt_mutex_unlock_impl().

## tall_log_ctx

void* tall_log_ctx = NULL

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