diff options
| author | Mark Stapp <mjs@voltanet.io> | 2019-10-17 10:07:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-17 10:07:05 -0400 |
| commit | 9cd06d69ad593dece680da49e3da6cfbb0af376e (patch) | |
| tree | 42c91151ca75a429c42ca5226e2212ac6593d996 /lib/yang.c | |
| parent | e75bbefa0e41995051d625aad3bfb5273ff3dc20 (diff) | |
| parent | 07705c8b8a8650c499c74a2b365caf6bd0c7db2e (diff) | |
Merge pull request #5175 from opensourcerouting/debug-nb-yang
lib, vtysh: add new libyang option to the "debug northbound" command
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) { |
