From d3ef9cad32478612ecb2fb64d5d12e487702e6ee Mon Sep 17 00:00:00 2001 From: Zenon Parker Date: Thu, 30 Aug 2018 14:28:12 -0400 Subject: [PATCH] Fix #111: Rename LogLevel enums (#112) --- include/cppkafka/detail/callback_invoker.h | 4 ++-- include/cppkafka/logging.h | 16 ++++++++-------- src/consumer.cpp | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/cppkafka/detail/callback_invoker.h b/include/cppkafka/detail/callback_invoker.h index 8b2d8d5..b21737f 100644 --- a/include/cppkafka/detail/callback_invoker.h +++ b/include/cppkafka/detail/callback_invoker.h @@ -101,7 +101,7 @@ public: try { // Log it handle_->get_configuration().get_log_callback()(*handle_, - static_cast(LogLevel::LOG_ERR), + static_cast(LogLevel::LogErr), library_name, error_msg.str()); } @@ -109,7 +109,7 @@ public: } else { rd_kafka_log_print(handle_->get_handle(), - static_cast(LogLevel::LOG_ERR), + static_cast(LogLevel::LogErr), library_name, error_msg.str().c_str()); } diff --git a/include/cppkafka/logging.h b/include/cppkafka/logging.h index 7d9737b..c4281c0 100644 --- a/include/cppkafka/logging.h +++ b/include/cppkafka/logging.h @@ -34,14 +34,14 @@ namespace cppkafka { // Based on syslog.h levels enum class LogLevel : int { - LOG_EMERG = 0, /* system is unusable */ - LOG_ALERT = 1, /* action must be taken immediately */ - LOG_CRIT = 2, /* critical conditions */ - LOG_ERR = 3, /* error conditions */ - LOG_WARNING = 4, /* warning conditions */ - LOG_NOTICE = 5, /* normal but significant condition */ - LOG_INFO = 6, /* informational */ - LOG_DEBUG = 7 /* debug-level messages */ + LogEmerg = 0, /* system is unusable */ + LogAlert = 1, /* action must be taken immediately */ + LogCrit = 2, /* critical conditions */ + LogErr = 3, /* error conditions */ + LogWarning = 4, /* warning conditions */ + LogNotice = 5, /* normal but significant condition */ + LogInfo = 6, /* informational */ + LogDebug = 7 /* debug-level messages */ }; } //cppkafka diff --git a/src/consumer.cpp b/src/consumer.cpp index 687de0e..1c2c6b8 100644 --- a/src/consumer.cpp +++ b/src/consumer.cpp @@ -99,10 +99,10 @@ Consumer::~Consumer() { error_cb(*this, static_cast(ex.get_error().get_error()), error_msg.str()); } else if (logger_cb) { - logger_cb(*this, static_cast(LogLevel::LOG_ERR), "cppkafka", error_msg.str()); + logger_cb(*this, static_cast(LogLevel::LogErr), "cppkafka", error_msg.str()); } else { - rd_kafka_log_print(get_handle(), static_cast(LogLevel::LOG_ERR), "cppkafka", error_msg.str().c_str()); + rd_kafka_log_print(get_handle(), static_cast(LogLevel::LogErr), "cppkafka", error_msg.str().c_str()); } } }