summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-11-02 15:17:50 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-02 15:39:31 +0100
commit79125ecf7d54b04cc56818b6dd99813d0a4daf89 (patch)
treea3f88348f3435ab9d23cb8e814c390586e2f6e16
parentbc9d9aced8c174bbb5fc265ec746621d31344be0 (diff)
log: Add new DLSTATS log level
This log level is used by the stats subsystem log reporter to report statistics to level INFO. Note that the default level of DLSTATS is NOTICE. Sponsored-by: On-Waves ehf
-rw-r--r--include/osmocom/core/logging.h3
-rw-r--r--src/logging.c5
-rw-r--r--src/stats.c5
3 files changed, 8 insertions, 5 deletions
diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index ba41762f..1c159d0b 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -69,7 +69,8 @@ void logp(int subsys, const char *file, int line, int cont, const char *format,
#define DLSMS -7
#define DLCTRL -8
#define DLGTP -9
-#define OSMO_NUM_DLIB 9
+#define DLSTATS -10
+#define OSMO_NUM_DLIB 10
struct log_category {
uint8_t loglevel;
diff --git a/src/logging.c b/src/logging.c
index 20b0596b..876964ae 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -117,6 +117,11 @@ static const struct log_info_cat internal_cat[OSMO_NUM_DLIB] = {
.description = "GPRS GTP library",
.enabled = 1, .loglevel = LOGL_NOTICE,
},
+ [INT2IDX(DLSTATS)] = {
+ .name = "DLSTATS",
+ .description = "Statistics messages and logging",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
};
/*! \brief descriptive string for each log level */
diff --git a/src/stats.c b/src/stats.c
index bdb0fbe6..b398d073 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -40,9 +40,6 @@
#include <osmocom/core/statistics.h>
#include <osmocom/core/msgb.h>
-/* TODO: register properly */
-#define DSTATS DLGLOBAL
-
#define STATS_DEFAULT_INTERVAL 5 /* secs */
#define STATS_DEFAULT_STATSD_BUFLEN 256
@@ -358,7 +355,7 @@ static int osmo_stats_reporter_log_send(struct osmo_stats_reporter *srep,
const char *name1, unsigned int index1, const char *name2, int value,
const char *unit)
{
- LOGP(DSTATS, LOGL_INFO,
+ LOGP(DLSTATS, LOGL_INFO,
"stats t=%s p=%s g=%s i=%u n=%s v=%d u=%s\n",
type, srep->name_prefix ? srep->name_prefix : "",
name1 ? name1 : "", index1,