diff --git a/src/log.c b/src/log.c index 8838ec2e..1a6dd805 100644 --- a/src/log.c +++ b/src/log.c @@ -35,7 +35,6 @@ */ ATOMIC_T verbose_level = 0; -void (*depr_print_clb)(NC_VERB_LEVEL level, const char *msg); void (*print_clb)(const struct nc_session *session, NC_VERB_LEVEL level, const char *msg); API void @@ -103,8 +102,6 @@ prv_vprintf(const struct nc_session *session, NC_VERB_LEVEL level, const char *f if (print_clb) { print_clb(session, level, prv_msg); - } else if (depr_print_clb) { - depr_print_clb(level, prv_msg); } else if (session && session->id) { fprintf(stderr, "Session %u %s: %s\n", session->id, verb[level].label, prv_msg); } else { @@ -126,21 +123,8 @@ prv_printf(const struct nc_session *session, NC_VERB_LEVEL level, const char *fo va_end(ap); } -static void -nc_ly_log_clb(LY_LOG_LEVEL lvl, const char *msg, const char *UNUSED(data_path), const char *UNUSED(schema_path), - uint64_t UNUSED(line)) -{ - if (print_clb) { - print_clb(NULL, (NC_VERB_LEVEL)lvl, msg); - } else if (depr_print_clb) { - depr_print_clb((NC_VERB_LEVEL)lvl, msg); - } -} - API void nc_set_print_clb_session(void (*clb)(const struct nc_session *, NC_VERB_LEVEL, const char *)) { print_clb = clb; - depr_print_clb = NULL; - ly_set_log_clb(nc_ly_log_clb); } diff --git a/src/log.h b/src/log.h index 8564db13..b4365ccc 100644 --- a/src/log.h +++ b/src/log.h @@ -74,8 +74,8 @@ void nc_libssh_thread_verbosity(int level); /** * @brief Set libnetconf print callback. * - * This callback is set for libnetconf2 and also libyang that is used internally. libyang - * callback can be set explicitly, but must be done so after calling this function. + * The callback is not set per-session, it is a global resource. It might be called with + * a NULL session parameter. * * @param[in] clb Callback that is called for every message. */