Skip to content

Commit

Permalink
melodic logging fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacharyTaylor committed Jun 13, 2018
1 parent 953a5a5 commit 141aeeb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libmavconn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ find_package(catkin REQUIRED)

## System dependencies are found with CMake's conventions
find_package(console_bridge REQUIRED)
if(console_bridge_VERSION GREATER 0.3.0)
add_definitions(-DDEFINE_LOGGING_MACROS)
endif ()

find_package(Boost REQUIRED COMPONENTS system)

# add package modules path, not needed in dependend packages
Expand Down
9 changes: 9 additions & 0 deletions libmavconn/include/mavconn/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
#include <stdexcept>
#include <mavconn/mavlink_dialect.h>

#ifdef DEFINE_LOGGING_MACROS

#define logError(fmt, ...) CONSOLE_BRIDGE_logError(fmt, ##__VA_ARGS__)
#define logWarn(fmt, ...) CONSOLE_BRIDGE_logWarn(fmt, ##__VA_ARGS__)
#define logInform(fmt, ...) CONSOLE_BRIDGE_logInform(fmt, ##__VA_ARGS__)
#define logDebug(fmt, ...) CONSOLE_BRIDGE_logDebug(fmt, ##__VA_ARGS__)

#endif

namespace mavconn {
namespace sig2 = boost::signals2;

Expand Down

0 comments on commit 141aeeb

Please sign in to comment.