|
| | 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) |
| |
| 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.
|
| |
| void | assert_loginfo (const char *src) |
| |
| static int | subsys_lib2index (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_parse_category_mask (struct log_target *target, const char *_mask) |
| | parse the log category mask
|
| |
| static const char * | color (int subsys) |
| |
| static const char * | level_color (int level) |
| |
| const char * | log_category_name (int subsys) |
| |
| static const char * | const_basename (const char *path) |
| |
| static int | _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 void | _output (struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap) |
| |
| static int | map_subsys (int subsys) |
| |
| static bool | should_log_to_target (struct log_target *tar, int subsys, int level) |
| |
| 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,...) |
| |
| 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.
|
| |
| 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_set_all_filter (struct log_target *target, int all) |
| | Enable the LOG_FLT_ALL log filter.
|
| |
| void | log_set_use_color (struct log_target *target, int use_color) |
| | Enable or disable the use of colored output.
|
| |
| void | log_set_print_timestamp (struct log_target *target, int print_timestamp) |
| | Enable or disable printing of timestamps while logging.
|
| |
| 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_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_set_category_filter (struct log_target *target, int category, int enable, int level) |
| | Set a category filter on a given log target.
|
| |
| static int | _file_wq_write_cb (struct osmo_fd *ofd, struct msgb *msg) |
| |
| 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) |
| |
| struct log_target * | log_target_create (void) |
| | Create a new log target skeleton.
|
| |
| struct log_target * | log_target_create_stderr (void) |
| | Create the STDERR log target.
|
| |
| struct log_target * | log_target_create_file_stream (const char *fname) |
| | Create a new file-based log target using buffered, blocking stream output.
|
| |
| 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.
|
| |
| struct log_target * | log_target_create_file (const char *fname) |
| | Create a new file-based log target using non-blocking write_queue.
|
| |
| struct log_target * | log_target_find (enum log_target_type type, const char *fname) |
| | Find a registered log target.
|
| |
| void | log_target_destroy (struct log_target *target) |
| | Unregister, close and delete a log target.
|
| |
| int | log_target_file_reopen (struct log_target *target) |
| | close and re-open a log file (for log file rotation)
|
| |
| int | log_targets_reopen (void) |
| | close and re-open all log files (for log file rotation)
|
| |
| 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.
|
| |
Debugging/Logging support code.