logging: Calculate LOG_MAX_{CTX,FILTERS} from the enum

Change-Id: I1ee1278b029e42321932b87f94aa3e0eeed4108a
Related: SYS#5232
This commit is contained in:
Daniel Willmann 2020-12-02 18:14:17 +01:00
parent cb3e9b5847
commit fd3478ca4f
1 changed files with 10 additions and 10 deletions

View File

@ -11,11 +11,6 @@
#include <osmocom/core/defs.h>
#include <osmocom/core/linuxlist.h>
/*! Maximum number of logging contexts */
#define LOG_MAX_CTX 8
/*! Maximum number of logging filters */
#define LOG_MAX_FILTERS 8
#ifndef DEBUG
#define DEBUG
#endif
@ -162,11 +157,6 @@ struct log_info_cat {
uint8_t enabled; /*!< is this category enabled or not */
};
/*! Log context information, passed to filter */
struct log_context {
void *ctx[LOG_MAX_CTX+1];
};
/*! Indexes to indicate the object currently acted upon.
* Array indexes for the global \a log_context array. */
enum log_ctx_index {
@ -191,6 +181,16 @@ enum log_filter_index {
_LOG_FLT_COUNT
};
/*! Maximum number of logging contexts */
#define LOG_MAX_CTX _LOG_CTX_COUNT
/*! Maximum number of logging filters */
#define LOG_MAX_FILTERS _LOG_FLT_COUNT
/*! Log context information, passed to filter */
struct log_context {
void *ctx[LOG_MAX_CTX+1];
};
/*! Compatibility with older libosmocore versions */
#define LOG_FILTER_ALL (1<<LOG_FLT_ALL)
/*! Compatibility with older libosmocore versions */