diff options
Diffstat (limited to 'lib/yang.c')
| -rw-r--r-- | lib/yang.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/yang.c b/lib/yang.c index 5470762ea6..d153f75530 100644 --- a/lib/yang.c +++ b/lib/yang.c @@ -616,6 +616,17 @@ static void ly_log_cb(LY_LOG_LEVEL level, const char *msg, const char *path) zlog(priority, "libyang: %s", msg); } +void yang_debugging_set(bool enable) +{ + if (enable) { + ly_verb(LY_LLDBG); + ly_verb_dbg(0xFF); + } else { + ly_verb(LY_LLERR); + ly_verb_dbg(0); + } +} + struct ly_ctx *yang_ctx_new_setup(void) { struct ly_ctx *ctx; @@ -645,10 +656,6 @@ void yang_init(void) ly_set_log_clb(ly_log_cb, 1); ly_log_options(LY_LOLOG | LY_LOSTORE); - /* Let libyang log everything possible. */ - ly_verb(LY_LLDBG); - ly_verb_dbg(0xFF); - /* Initialize libyang container for native models. */ ly_native_ctx = yang_ctx_new_setup(); if (!ly_native_ctx) { |
