Skip to content

Commit

Permalink
* Fixed logger thread local check in Logger::log
Browse files Browse the repository at this point in the history
* Updated WorkerThread to set thread name before init
* Fixed BufferFilter check on fragmentation (this was not previously being done and caused all fragmentation attempts to fail over the wire)
  • Loading branch information
jredmondson committed Oct 1, 2018
1 parent ba15fe2 commit b21b02a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/madara/logger/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ std::string madara::logger::Logger::search_and_insert_custom_tstamp(

void madara::logger::Logger::log(int level, const char* message, ...)
{
if (level <= level_)
if (level <= get_thread_level() || level <= level_)
{
va_list argptr;
va_start(argptr, message);
Expand Down
7 changes: 4 additions & 3 deletions include/madara/threads/WorkerThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ int WorkerThread::svc(void)
utility::java::Acquire_VM jvm(false);
#endif

#ifndef MADARA_NO_THREAD_LOCAL
madara::logger::Logger::set_thread_name(name_);
#endif

thread_->init(data_);

{
Expand All @@ -186,9 +190,6 @@ int WorkerThread::svc(void)

terminated = control_.get_ref(name_ + ".terminated");
paused = control_.get_ref(name_ + ".paused");
#ifndef MADARA_NO_THREAD_LOCAL
madara::logger::Logger::set_thread_name(name_);
#endif

// change thread frequency
change_frequency(
Expand Down
2 changes: 1 addition & 1 deletion include/madara/transport/QoSTransportSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ int madara::transport::QoSTransportSettings::filter_decode(
std::string header_id(header.id);

// id is either karl or KaRL. If it's anything else, then error
if (header_id == "karl" || header_id == "KaRL")
if (header_id == "karl" || header_id == "KaRL" || header_id == "KFRG")
{
madara_logger_ptr_log(logger::global_logger.get(), logger::LOG_MAJOR,
"QoSTransportSettings::filter_decode: header: "
Expand Down

0 comments on commit b21b02a

Please sign in to comment.