logger CHANGE rename ly_verb() to ly_log_level()
Align the setter function with the LY_LOG_LEVEL enums to simplify their
association.
diff --git a/src/common.h b/src/common.h
index b1ff0fe..09f0698 100644
--- a/src/common.h
+++ b/src/common.h
@@ -67,7 +67,7 @@
};
extern THREAD_LOCAL enum int_log_opts log_opt;
-extern volatile LY_LOG_LEVEL ly_log_level;
+extern volatile LY_LOG_LEVEL ly_ll;
extern volatile uint32_t ly_log_opts;
/**
diff --git a/src/log.c b/src/log.c
index d6032c4..dd456d3 100644
--- a/src/log.c
+++ b/src/log.c
@@ -31,7 +31,7 @@
#include "tree_data.h"
#include "tree_schema.h"
-volatile LY_LOG_LEVEL ly_log_level = LY_LLWRN;
+volatile LY_LOG_LEVEL ly_ll = LY_LLWRN;
volatile uint32_t ly_log_opts = LY_LOLOG | LY_LOSTORE_LAST;
static ly_log_clb log_clb;
static volatile ly_bool path_flag = 1;
@@ -193,11 +193,11 @@
}
API LY_LOG_LEVEL
-ly_verb(LY_LOG_LEVEL level)
+ly_log_level(LY_LOG_LEVEL level)
{
- LY_LOG_LEVEL prev = ly_log_level;
+ LY_LOG_LEVEL prev = ly_ll;
- ly_log_level = level;
+ ly_ll = level;
return prev;
}
@@ -307,7 +307,7 @@
char *msg = NULL;
ly_bool free_strs;
- if (level > ly_log_level) {
+ if (level > ly_ll) {
/* do not print or store the message */
free(path);
return;
@@ -480,7 +480,7 @@
char *plugin_msg;
int ret;
- if (ly_log_level < level) {
+ if (ly_ll < level) {
return;
}
ret = asprintf(&plugin_msg, "Extension plugin \"%s\": %s)", ext->def->plugin->id, format);
diff --git a/src/log.h b/src/log.h
index 733f102..1b95e0c 100644
--- a/src/log.h
+++ b/src/log.h
@@ -57,7 +57,7 @@
* @param[in] level Verbosity level.
* @return Previous verbosity level.
*/
-LY_LOG_LEVEL ly_verb(LY_LOG_LEVEL level);
+LY_LOG_LEVEL ly_log_level(LY_LOG_LEVEL level);
/**
* @defgroup logopts Logging options
diff --git a/src/xpath.c b/src/xpath.c
index ba16ede..19ec938 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -134,7 +134,7 @@
uint16_t i, j;
char tmp[128];
- if (!exp || (ly_log_level < LY_LLDBG)) {
+ if (!exp || (ly_ll < LY_LLDBG)) {
return;
}
@@ -168,7 +168,7 @@
struct lyxp_set_node *item;
struct lyxp_set_scnode *sitem;
- if (ly_log_level < LY_LLDBG) {
+ if (ly_ll < LY_LLDBG) {
return;
}