]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/yang.c
lib, vtysh: add new libyang option to the "debug northbound" command
[mirror_frr.git] / lib / yang.c
index 5470762ea6fa670ed1963eeb7f13656d62c46c0c..d153f755305a49a77f399bc7517b7f4130b7c394 100644 (file)
@@ -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) {