libosmocore
0.9.6.277-11f2
Osmocom core library
|
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdbool.h>
#include <osmocom/core/defs.h>
#include <osmocom/core/linuxlist.h>
Go to the source code of this file.
Data Structures | |
struct | log_category |
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 |
structure representing a logging target More... | |
Macros | |
#define | LOG_MAX_CTX 8 |
Maximum number of logging contexts. | |
#define | LOG_MAX_FILTERS 8 |
Maximum number of logging filters. | |
#define | DEBUG |
#define | DEBUGP(ss, fmt, args...) LOGP(ss, LOGL_DEBUG, fmt, ##args) |
Log a debug message through the Osmocom logging framework. More... | |
#define | DEBUGPC(ss, fmt, args...) LOGPC(ss, LOGL_DEBUG, fmt, ##args) |
#define | LOGP(ss, level, fmt, args...) LOGPSRC(ss, level, NULL, 0, fmt, ## args) |
Log a new message through the Osmocom logging framework. More... | |
#define | LOGPC(ss, level, fmt, args...) |
Continue a log message through the Osmocom logging framework. More... | |
#define | LOGPSRC(ss, level, caller_file, caller_line, fmt, args...) |
Log through the Osmocom logging framework with explicit source. If caller_file is passed as NULL, BASE_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). More... | |
#define | LOGL_DEBUG 1 |
different log levels More... | |
#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 |
#define | DLLAPD -2 |
#define | DLINP -3 |
#define | DLMUX -4 |
#define | DLMI -5 |
#define | DLMIB -6 |
#define | DLSMS -7 |
#define | DLCTRL -8 |
#define | DLGTP -9 |
#define | DLSTATS -10 |
#define | DLGSUP -11 |
#define | DLOAP -12 |
#define | DLSS7 -13 |
#define | DLSCCP -14 |
#define | DLSUA -15 |
#define | DLM3UA -16 |
#define | OSMO_NUM_DLIB 16 |
#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. | |
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_COUNT } |
Indexes to indicate the object currently acted upon. Array indexes for the global log_context array. | |
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_COUNT } |
Indexes to indicate objects that should be logged. Array indexes to log_target->filter_data and bit indexes for log_target->filter_map. | |
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 } |
Type of logging target. 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 More... | |
void | logp (int subsys, const char *file, int line, int cont, const char *format,...) OSMO_DEPRECATED("Use DEBUGP* macros instead") |
logging function used by DEBUGP() macro More... | |
void | logp2 (int subsys, unsigned int level, const char *file, int line, int cont, const char *format,...) __attribute__((format(printf |
void int | log_init (const struct log_info *inf, void *talloc_ctx) |
Initialize the Osmocom logging core. More... | |
void | log_fini (void) |
int | log_check_level (int subsys, unsigned int level) |
Check whether a log entry will be generated. More... | |
void | log_reset_context (void) |
Reset (clear) the logging context. | |
int | log_set_context (uint8_t ctx, void *value) |
Set the logging context. More... | |
void | log_set_all_filter (struct log_target *target, int) |
Enable the LOG_FLT_ALL log filter. More... | |
void | log_set_use_color (struct log_target *target, int) |
Enable or disable the use of colored output. More... | |
void | log_set_print_extended_timestamp (struct log_target *target, int) |
Enable or disable printing of extended timestamps while logging. More... | |
void | log_set_print_timestamp (struct log_target *target, int) |
Enable or disable printing of timestamps while logging. More... | |
void | log_set_print_filename (struct log_target *target, int) |
Enable or disable printing of the filename while logging. More... | |
void | log_set_print_category (struct log_target *target, int) |
Enable or disable printing of the category name. More... | |
void | log_set_log_level (struct log_target *target, int log_level) |
Set the global log level for a given log target. More... | |
void | log_parse_category_mask (struct log_target *target, const char *mask) |
parse the log category mask More... | |
const char * | log_category_name (int subsys) |
int | log_parse_level (const char *lvl) |
Parse a human-readable log level into a numeric value. More... | |
const char * | log_level_str (unsigned int lvl) |
convert a numeric log level into human-readable string More... | |
int | log_parse_category (const char *category) |
parse a human-readable log category into numeric form More... | |
void | log_set_category_filter (struct log_target *target, int category, int enable, int level) |
Set a category filter on a given log target. More... | |
struct log_target * | log_target_create (void) |
Create a new log target skeleton. More... | |
void | log_target_destroy (struct log_target *target) |
Unregister, close and delete a log target. More... | |
struct log_target * | log_target_create_stderr (void) |
Create the STDERR log target. More... | |
struct log_target * | log_target_create_file (const char *fname) |
Create a new file-based log target. More... | |
struct log_target * | log_target_create_syslog (const char *ident, int option, int facility) |
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. More... | |
int | log_target_file_reopen (struct log_target *tgt) |
close and re-open a log file (for log file rotation) More... | |
int | log_targets_reopen (void) |
close and re-open all log files (for log file rotation) More... | |
void | log_add_target (struct log_target *target) |
Register a new log target with the logging core. More... | |
void | log_del_target (struct log_target *target) |
Unregister a log target from the logging core. More... | |
const char * | log_vty_command_string () OSMO_DEPRECATED("For internal use inside libosmocore only.") |
Generates the logging command string for VTY. More... | |
const char * | log_vty_command_description () OSMO_DEPRECATED("For internal use inside libosmocore only.") |
Generates the logging command description for VTY. More... | |
struct log_target * | log_target_find (int type, const char *fname) |
Find a registered log target. More... | |
Variables | |
struct llist_head | osmo_log_target_list |