libosmocore 1.13.1.1-afb4 Osmocom core library

logging_internal.h
Go to the documentation of this file.
1#pragma once
2
7#include <stdbool.h>
8#include <osmocom/core/logging.h>
9#include <osmocom/core/utils.h>
10
11/* maximum length of the log string of a single log event (typically line) */
12#define MAX_LOG_SIZE 4096
13
14/* maximum number of log statements we queue in file/stderr target write queue */
15#define LOG_WQUEUE_LEN 156
16
17 struct log_thread_state {
18 /* Whether we are inside a code path to generate logging output: */
19 bool logging_active;
20 /* Cache TID: */
21 long int tid;
22};
23
24 extern void *tall_log_ctx;
25 extern struct log_info *osmo_log_info;
26 extern const struct value_string loglevel_strs[];
27 extern struct llist_head osmo_log_target_list;
28 extern __thread struct log_thread_state log_thread_state;
29
30 void assert_loginfo(const char *src);
31
32 int log_output_buf(char *buf, int buf_len, struct log_target *target, unsigned int subsys,
33 unsigned int level, const char *file, int line, int cont,
34 const char *format, va_list ap);
35
36 void log_target_file_destroy(struct log_target *target);
37
file
write Write running configuration to or terminal n Write configuration to the file(same as write file)\n") ALIAS(config_write_file
tall_log_ctx
void * tall_log_ctx
Definition: logging.c:84
osmo_log_info
struct log_info * osmo_log_info
Definition: logging.c:81
osmo_log_target_list
struct llist_head osmo_log_target_list
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.
Definition: logging.c:563
assert_loginfo
void assert_loginfo(const char *src)
Definition: logging.c:398
log_target_file_destroy
void log_target_file_destroy(struct log_target *target)
Definition: logging_file.c:154
loglevel_strs
const struct value_string loglevel_strs[]
Definition: logging.c:213
subsys
char subsys[16]
logging sub-system
Definition: gsmtap.h:9
level
uint8_t level
logging level
Definition: gsmtap.h:6
logging.h
llist_head
(double) linked list header structure
Definition: linuxlist.h:46
log_info
Logging configuration, passed to log_init.
Definition: logging.h:259
log_target
Definition: logging.h:304
log_thread_state
Definition: logging_internal.h:17
log_thread_state::logging_active
bool logging_active
Definition: logging_internal.h:19
log_thread_state::tid
long int tid
Definition: logging_internal.h:21
value_string
A mapping between human-readable string and numeric value.
Definition: utils.h:51
utils.h