44 * @author Michal Vasko <mvasko@cesnet.cz>
55 * @brief Logger manipulation routines and error definitions.
66 *
7- * Copyright (c) 2015 - 2022 CESNET, z.s.p.o.
7+ * Copyright (c) 2015 - 2026 CESNET, z.s.p.o.
88 *
99 * This source code is licensed under BSD 3-Clause License (the "License").
1010 * You may not use this file except in compliance with the License.
@@ -127,7 +127,7 @@ LIBYANG_API_DECL LY_LOG_LEVEL ly_log_level(LY_LOG_LEVEL level);
127127 */
128128
129129/**
130- * @brief Set logger options. Default is #LY_LOLOG | #LY_LOSTORE_LAST.
130+ * @brief Set global logger options. Default is #LY_LOLOG | #LY_LOSTORE_LAST.
131131 *
132132 * To get the current value, the function must be called twice resetting the level by the received value.
133133 *
@@ -137,7 +137,7 @@ LIBYANG_API_DECL LY_LOG_LEVEL ly_log_level(LY_LOG_LEVEL level);
137137LIBYANG_API_DECL uint32_t ly_log_options (uint32_t opts );
138138
139139/**
140- * @brief Set temporary thread-safe logger options overwriting those set by ::ly_log_options().
140+ * @brief Set temporary thread-safe (thread-specific) logger options overwriting those set by ::ly_log_options().
141141 *
142142 * @param[in] opts Pointer to the temporary @ref logopts. If NULL, restores the effect of global logger options.
143143 * @return Previous temporary options.
@@ -187,7 +187,7 @@ typedef void (*ly_log_clb)(LY_LOG_LEVEL level, const char *msg, const char *data
187187 uint64_t line );
188188
189189/**
190- * @brief Set logger callback.
190+ * @brief Set global logger callback.
191191 *
192192 * Is not affected by global log level.
193193 *
@@ -196,12 +196,22 @@ typedef void (*ly_log_clb)(LY_LOG_LEVEL level, const char *msg, const char *data
196196LIBYANG_API_DECL void ly_set_log_clb (ly_log_clb clb );
197197
198198/**
199- * @brief Get logger callback.
199+ * @brief Get global logger callback.
200200 *
201201 * @return Logger callback (can be NULL).
202202 */
203203LIBYANG_API_DECL ly_log_clb ly_get_log_clb (void );
204204
205+ /**
206+ * @brief Set temporary thread-safe (thread-specific) logger callback ovewriting that set by ::ly_set_log_clb.
207+ *
208+ * Is not affected by global log level.
209+ *
210+ * @param[in] clb Logging callback.
211+ * @return Previous temporary logging callback.
212+ */
213+ LIBYANG_API_DECL ly_log_clb ly_temp_log_clb (ly_log_clb clb );
214+
205215/** @} log */
206216
207217/**
0 commit comments