mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Fix setting debug log level
This commit is contained in:
parent
786863cf0e
commit
252da0b834
3 changed files with 12 additions and 4 deletions
|
|
@ -701,7 +701,7 @@ static void dmubus_schedule_blacklisted_ubus_recovery(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BBF_DEBUG("Next blacklisted ubus recovery scheduled in %d msecs", next_check_time);
|
BBF_DEBUG("Pid %d, Next blacklisted ubus recovery scheduled in %d msecs", getpid(), next_check_time);
|
||||||
uloop_timeout_set(&blacklisted_ubus_recovery_timer, next_check_time);
|
uloop_timeout_set(&blacklisted_ubus_recovery_timer, next_check_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
static void *deamon_lib_handle = NULL;
|
static void *deamon_lib_handle = NULL;
|
||||||
|
static uint8_t s_log_level = 0xff;
|
||||||
|
|
||||||
static void bbfdm_ctx_cleanup(struct bbfdm_context *u)
|
static void bbfdm_ctx_cleanup(struct bbfdm_context *u)
|
||||||
{
|
{
|
||||||
|
|
@ -963,7 +964,7 @@ static void register_bbfdm_apply_event(struct bbfdm_context *bbfdm_ctx)
|
||||||
|
|
||||||
int bbfdm_ubus_regiter_init(struct bbfdm_context *bbfdm_ctx)
|
int bbfdm_ubus_regiter_init(struct bbfdm_context *bbfdm_ctx)
|
||||||
{
|
{
|
||||||
int err = 0, cur_log_mask=0;
|
int err = 0;
|
||||||
|
|
||||||
err = ubus_connect_ctx(&bbfdm_ctx->ubus_ctx, NULL);
|
err = ubus_connect_ctx(&bbfdm_ctx->ubus_ctx, NULL);
|
||||||
if (err != UBUS_STATUS_OK) {
|
if (err != UBUS_STATUS_OK) {
|
||||||
|
|
@ -972,8 +973,7 @@ int bbfdm_ubus_regiter_init(struct bbfdm_context *bbfdm_ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the logmask with default, if not already set by api
|
// Set the logmask with default, if not already set by api
|
||||||
cur_log_mask = setlogmask(0);
|
if (s_log_level == 0xff) {
|
||||||
if (cur_log_mask == 0xff) {
|
|
||||||
BBF_INFO("Log level not set, setting default value %d", LOG_ERR);
|
BBF_INFO("Log level not set, setting default value %d", LOG_ERR);
|
||||||
bbfdm_ubus_set_log_level(LOG_ERR);
|
bbfdm_ubus_set_log_level(LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
@ -1031,6 +1031,12 @@ void bbfdm_ubus_set_service_name(struct bbfdm_context *bbfdm_ctx, const char *sr
|
||||||
void bbfdm_ubus_set_log_level(int log_level)
|
void bbfdm_ubus_set_log_level(int log_level)
|
||||||
{
|
{
|
||||||
setlogmask(LOG_UPTO(log_level));
|
setlogmask(LOG_UPTO(log_level));
|
||||||
|
s_log_level = log_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t bbfdm_ubus_get_log_level(void)
|
||||||
|
{
|
||||||
|
return s_log_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bbfdm_ubus_load_data_model(DM_MAP_OBJ *DynamicObj)
|
void bbfdm_ubus_load_data_model(DM_MAP_OBJ *DynamicObj)
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ int bbfdm_ubus_regiter_free(struct bbfdm_context *bbfdm_ctx);
|
||||||
int bbfdm_print_data_model_schema(struct bbfdm_context *bbfdm_ctx, const enum bbfdm_type_enum type);
|
int bbfdm_print_data_model_schema(struct bbfdm_context *bbfdm_ctx, const enum bbfdm_type_enum type);
|
||||||
|
|
||||||
void bbfdm_ubus_set_service_name(struct bbfdm_context *bbfdm_ctx, const char *srv_name);
|
void bbfdm_ubus_set_service_name(struct bbfdm_context *bbfdm_ctx, const char *srv_name);
|
||||||
|
|
||||||
|
uint8_t bbfdm_ubus_get_log_level(void);
|
||||||
void bbfdm_ubus_set_log_level(int log_level);
|
void bbfdm_ubus_set_log_level(int log_level);
|
||||||
void bbfdm_ubus_load_data_model(DM_MAP_OBJ *DynamicObj);
|
void bbfdm_ubus_load_data_model(DM_MAP_OBJ *DynamicObj);
|
||||||
int bbfdm_refresh_references(unsigned int dm_type, const char *srv_obj_name);
|
int bbfdm_refresh_references(unsigned int dm_type, const char *srv_obj_name);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue