Skip to content

Commit

Permalink
Fix #111: Rename LogLevel enums (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenonparker authored and mfontanini committed Aug 30, 2018
1 parent df04b27 commit d3ef9ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions include/cppkafka/detail/callback_invoker.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ class CallbackInvoker
try {
// Log it
handle_->get_configuration().get_log_callback()(*handle_,
static_cast<int>(LogLevel::LOG_ERR),
static_cast<int>(LogLevel::LogErr),
library_name,
error_msg.str());
}
catch (...) {} // sink everything
}
else {
rd_kafka_log_print(handle_->get_handle(),
static_cast<int>(LogLevel::LOG_ERR),
static_cast<int>(LogLevel::LogErr),
library_name,
error_msg.str().c_str());
}
Expand Down
16 changes: 8 additions & 8 deletions include/cppkafka/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ Consumer::~Consumer() {
error_cb(*this, static_cast<int>(ex.get_error().get_error()), error_msg.str());
}
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 {
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());
}
}
}
Expand Down

0 comments on commit d3ef9ca

Please sign in to comment.