7 #include "hazelcast/util/export.h"
9 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
11 #pragma warning(disable: 4251)
14 #ifndef HZ_LOGGING_DISABLED
15 #define HZ_LOG(lg, lvl, msg) \
16 if ((lg).enabled( ::hazelcast::logger::level::lvl )) { \
17 (lg).log(::hazelcast::logger::level::lvl, ( msg )); \
20 #define HZ_LOG(lg, lvl, msg)
33 using handler_type = std::function<void(
const std::string &,
36 const std::string &)>;
38 logger(std::string instance_name, std::string cluster_name,
39 level lvl, handler_type handler);
41 bool enabled(level lvl) noexcept;
43 void log(level lvl,
const std::string &msg) noexcept;
45 static void default_handler(
const std::string &instance_name,
46 const std::string &cluster_name,
48 const std::string &msg) noexcept;
51 const std::string instance_name_;
52 const std::string cluster_name_;
54 const handler_type handler_;
57 enum class logger::level : int {
58 all = (std::numeric_limits<int>::min)(),
65 off = (std::numeric_limits<int>::max)()
68 HAZELCAST_API std::ostream& operator<<(std::ostream&, logger::level level);
72 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)