rename log_info to osmo_log_info to avoid namespace clash with app

This commit is contained in:
Harald Welte 2010-05-19 19:54:00 +02:00
parent 93cf5a38eb
commit 4ebdf74728
2 changed files with 17 additions and 17 deletions

View File

@ -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;
}

View File

@ -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;
}