Fix #111: Rename LogLevel enums (#112)

This commit is contained in:
Zenon Parker
2018-08-30 14:28:12 -04:00
committed by Matias Fontanini
parent df04b27e22
commit d3ef9cad32
3 changed files with 12 additions and 12 deletions

View File

@@ -101,7 +101,7 @@ public:
try { try {
// Log it // Log it
handle_->get_configuration().get_log_callback()(*handle_, handle_->get_configuration().get_log_callback()(*handle_,
static_cast<int>(LogLevel::LOG_ERR), static_cast<int>(LogLevel::LogErr),
library_name, library_name,
error_msg.str()); error_msg.str());
} }
@@ -109,7 +109,7 @@ public:
} }
else { else {
rd_kafka_log_print(handle_->get_handle(), rd_kafka_log_print(handle_->get_handle(),
static_cast<int>(LogLevel::LOG_ERR), static_cast<int>(LogLevel::LogErr),
library_name, library_name,
error_msg.str().c_str()); error_msg.str().c_str());
} }

View File

@@ -34,14 +34,14 @@ namespace cppkafka {
// Based on syslog.h levels // Based on syslog.h levels
enum class LogLevel : int { enum class LogLevel : int {
LOG_EMERG = 0, /* system is unusable */ LogEmerg = 0, /* system is unusable */
LOG_ALERT = 1, /* action must be taken immediately */ LogAlert = 1, /* action must be taken immediately */
LOG_CRIT = 2, /* critical conditions */ LogCrit = 2, /* critical conditions */
LOG_ERR = 3, /* error conditions */ LogErr = 3, /* error conditions */
LOG_WARNING = 4, /* warning conditions */ LogWarning = 4, /* warning conditions */
LOG_NOTICE = 5, /* normal but significant condition */ LogNotice = 5, /* normal but significant condition */
LOG_INFO = 6, /* informational */ LogInfo = 6, /* informational */
LOG_DEBUG = 7 /* debug-level messages */ LogDebug = 7 /* debug-level messages */
}; };
} //cppkafka } //cppkafka

View File

@@ -99,10 +99,10 @@ Consumer::~Consumer() {
error_cb(*this, static_cast<int>(ex.get_error().get_error()), error_msg.str()); error_cb(*this, static_cast<int>(ex.get_error().get_error()), error_msg.str());
} }
else if (logger_cb) { else if (logger_cb) {
logger_cb(*this, static_cast<int>(LogLevel::LOG_ERR), "cppkafka", error_msg.str()); logger_cb(*this, static_cast<int>(LogLevel::LogErr), "cppkafka", error_msg.str());
} }
else { else {
rd_kafka_log_print(get_handle(), static_cast<int>(LogLevel::LOG_ERR), "cppkafka", error_msg.str().c_str()); rd_kafka_log_print(get_handle(), static_cast<int>(LogLevel::LogErr), "cppkafka", error_msg.str().c_str());
} }
} }
} }