summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-19 19:54:00 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-25 22:28:40 +0200
commit4ebdf747286541c52311517fbedd0cb128631a61 (patch)
treed20cf230542113607d2b7ee02f786e3a20dd06c9 /src
parent93cf5a38eb503128016ce57f71071ca2f4415650 (diff)
rename log_info to osmo_log_info to avoid namespace clash with app
Diffstat (limited to 'src')
-rw-r--r--src/logging.c30
-rw-r--r--src/vty/logging_vty.c4
2 files changed, 17 insertions, 17 deletions
diff --git a/src/logging.c b/src/logging.c
index 531cea6c..1dc30db3 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -37,7 +37,7 @@
#include <osmocore/utils.h>
#include <osmocore/logging.h>
-const struct log_info *log_info;
+const struct log_info *osmo_log_info;
static struct log_context log_context;
static void *tall_log_ctx = NULL;
@@ -67,8 +67,8 @@ int log_parse_category(const char *category)
{
int i;
- for (i = 0; i < log_info->num_cat; ++i) {
- if (!strcasecmp(log_info->cat[i].name+1, category))
+ for (i = 0; i < osmo_log_info->num_cat; ++i) {
+ if (!strcasecmp(osmo_log_info->cat[i].name+1, category))
return i;
}
@@ -92,15 +92,15 @@ void log_parse_category_mask(struct log_target* target, const char *_mask)
category_token = strtok(mask, ":");
do {
- for (i = 0; i < log_info->num_cat; ++i) {
+ for (i = 0; i < osmo_log_info->num_cat; ++i) {
char* colon = strstr(category_token, ",");
int length = strlen(category_token);
if (colon)
length = colon - category_token;
- if (strncasecmp(log_info->cat[i].name, category_token,
- length) == 0) {
+ if (strncasecmp(osmo_log_info->cat[i].name,
+ category_token, length) == 0) {
int level = 0;
if (colon)
@@ -117,8 +117,8 @@ void log_parse_category_mask(struct log_target* target, const char *_mask)
static const char* color(int subsys)
{
- if (subsys < log_info->num_cat)
- return log_info->cat[subsys].color;
+ if (subsys < osmo_log_info->num_cat)
+ return osmo_log_info->cat[subsys].color;
return NULL;
}
@@ -198,8 +198,8 @@ static void _logp(unsigned int subsys, int level, char *file, int line,
* say stop, continue, output */
if ((tar->filter_map & LOG_FILTER_ALL) != 0)
output = 1;
- else if (log_info->filter_fn)
- output = log_info->filter_fn(&log_context,
+ else if (osmo_log_info->filter_fn)
+ output = osmo_log_info->filter_fn(&log_context,
tar);
if (output) {
@@ -306,7 +306,7 @@ void log_set_log_level(struct log_target *target, int log_level)
void log_set_category_filter(struct log_target *target, int category,
int enable, int level)
{
- if (category >= log_info->num_cat)
+ if (category >= osmo_log_info->num_cat)
return;
target->categories[category].enabled = !!enable;
target->categories[category].loglevel = level;
@@ -333,10 +333,10 @@ struct log_target *log_target_create(void)
INIT_LLIST_HEAD(&target->entry);
/* initialize the per-category enabled/loglevel from defaults */
- for (i = 0; i < log_info->num_cat; i++) {
+ for (i = 0; i < osmo_log_info->num_cat; i++) {
struct log_category *cat = &target->categories[i];
- cat->enabled = log_info->cat[i].enabled;
- cat->loglevel = log_info->cat[i].loglevel;
+ cat->enabled = osmo_log_info->cat[i].enabled;
+ cat->loglevel = osmo_log_info->cat[i].loglevel;
}
/* global settings */
@@ -415,5 +415,5 @@ const char *log_vty_category_string(struct log_info *info)
void log_init(const struct log_info *cat)
{
tall_log_ctx = talloc_named_const(NULL, 1, "logging");
- log_info = cat;
+ osmo_log_info = cat;
}
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index a7871963..896d79a9 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -33,7 +33,7 @@
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
-extern const struct log_info *log_info;
+extern const struct log_info *osmo_log_info;
static void _vty_output(struct log_target *tgt, const char *line)
{
@@ -291,7 +291,7 @@ DEFUN(show_logging_vty,
vty_out(vty, "Logging was not enabled.%s", VTY_NEWLINE);
return CMD_WARNING;
}
- vty_print_logtarget(vty, log_info, conn->dbg);
+ vty_print_logtarget(vty, osmo_log_info, conn->dbg);
return CMD_SUCCESS;
}