diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2011-07-28 21:02:38 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2011-07-28 21:02:38 +0200 |
commit | 7a9b3f45b278c5664bd8f76b692febb84dee6a71 (patch) | |
tree | f8fcee858a6008300d42d170739bdbd4ead740c8 /src/shared/libosmocore/include/osmocom/core/logging.h | |
parent | 8d24b2f3953cf6c02ec3ec09a88d152d6993470a (diff) | |
parent | 430be849945688ae107b079db1e216329b1a1f06 (diff) |
Merge commit '430be849945688ae107b079db1e216329b1a1f06'
Diffstat (limited to 'src/shared/libosmocore/include/osmocom/core/logging.h')
-rw-r--r-- | src/shared/libosmocore/include/osmocom/core/logging.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/shared/libosmocore/include/osmocom/core/logging.h b/src/shared/libosmocore/include/osmocom/core/logging.h index db029402..06d90e52 100644 --- a/src/shared/libosmocore/include/osmocom/core/logging.h +++ b/src/shared/libosmocore/include/osmocom/core/logging.h @@ -5,7 +5,6 @@ #include <stdint.h> #include <osmocom/core/linuxlist.h> -#define LOG_MAX_CATEGORY 32 #define LOG_MAX_CTX 8 #define LOG_MAX_FILTERS 8 @@ -20,7 +19,7 @@ #endif -void logp(unsigned int subsys, char *file, int line, int cont, const char *format, ...) __attribute__ ((format (printf, 5, 6))); +void logp(int subsys, char *file, int line, int cont, const char *format, ...) __attribute__ ((format (printf, 5, 6))); /* new logging interface */ #define LOGP(ss, level, fmt, args...) \ @@ -37,6 +36,15 @@ void logp(unsigned int subsys, char *file, int line, int cont, const char *forma #define LOG_FILTER_ALL 0x0001 +/* logging levels defined by the library itself */ +#define DLGLOBAL -1 +#define DLLAPDM -2 +#define DLINP -3 +#define DLMUX -4 +#define DLMI -5 +#define DLMIB -6 +#define OSMO_NUM_DLIB 7 + struct log_category { uint8_t loglevel; uint8_t enabled; @@ -65,8 +73,9 @@ struct log_info { log_filter *filter_fn; /* per-category information */ - const struct log_info_cat *cat; + struct log_info_cat *cat; unsigned int num_cat; + unsigned int num_cat_user; }; enum log_target_type { @@ -82,10 +91,11 @@ struct log_target { int filter_map; void *filter_data[LOG_MAX_FILTERS+1]; - struct log_category categories[LOG_MAX_CATEGORY+1]; + struct log_category *categories; + uint8_t loglevel; - int use_color:1; - int print_timestamp:1; + unsigned int use_color:1; + unsigned int print_timestamp:1; enum log_target_type type; @@ -110,10 +120,10 @@ struct log_target { }; /* use the above macros */ -void logp2(unsigned int subsys, unsigned int level, char *file, +void logp2(int subsys, unsigned int level, char *file, int line, int cont, const char *format, ...) __attribute__ ((format (printf, 6, 7))); -void log_init(const struct log_info *cat); +int log_init(const struct log_info *inf, void *talloc_ctx); /* context management */ void log_reset_context(void); |