From 886e548ab080896da6760036f38b93ff97fd01a4 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 16 Jan 2018 01:49:37 +0100 Subject: logging: add ability to log the log-level with API and vty Log the log level string after the category name, if enabled. The default behavior remains unchanged. Change-Id: Ie6be365cfa6aeabdf115bff19bac198440c9adf1 --- include/osmocom/core/logging.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 922cbf6e..1e809d0a 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -298,6 +298,9 @@ struct log_target { void (*raw_output)(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap); + + /* Should the log level be printed? */ + bool print_level; }; /* use the above macros */ @@ -320,6 +323,7 @@ void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); void log_set_print_category(struct log_target *target, int); +void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); const char* log_category_name(int subsys); -- cgit v1.2.3