Commit 3aa49152b7f951ce9bbb4837e16273f14c3ce6db

Authored by Patric Stout
1 parent 3c3a273b

chore: mention setLogger lambda should be thread-safe

Showing 1 changed file with 2 additions and 0 deletions
include/TrueMQTT.h
@@ -152,6 +152,8 @@ namespace TrueMQTT @@ -152,6 +152,8 @@ namespace TrueMQTT
152 * 152 *
153 * @note This library doesn't contain a logger, so you need to provide one. 153 * @note This library doesn't contain a logger, so you need to provide one.
154 * If this method is not called, no logging will be done. 154 * If this method is not called, no logging will be done.
  155 + * @note The logger callback can be called from several threads, so make sure
  156 + * the callback is thread-safe.
155 */ 157 */
156 void setLogger(LogLevel log_level, const std::function<void(LogLevel, std::string_view)> &logger) const; 158 void setLogger(LogLevel log_level, const std::function<void(LogLevel, std::string_view)> &logger) const;
157 159