Skip to content

Commit 5fd8524

Browse files
authored
Hand-code logging.hpp (#2870)
With the similar rewrite coming in rcutils logging macros, this is now required (since the old machinery relied on the removed code in rcutils). Regardless, I think this is more readable and maintainable. Note that this does *not* remove the python3-empy dependency, since that is still needed for other things. Signed-off-by: Chris Lalancette <[email protected]>
1 parent e677f4c commit 5fd8524

File tree

5 files changed

+1002
-186
lines changed

5 files changed

+1002
-186
lines changed

rclcpp/CMakeLists.txt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -146,27 +146,6 @@ set(Python3_FIND_UNVERSIONED_NAMES FIRST)
146146

147147
find_package(Python3 REQUIRED COMPONENTS Interpreter)
148148

149-
# "watch" template for changes
150-
configure_file(
151-
"resource/logging.hpp.em"
152-
"logging.hpp.em.watch"
153-
COPYONLY
154-
)
155-
# generate header with logging macros
156-
set(python_code_logging
157-
"import em"
158-
"em.invoke(['-o', 'include/rclcpp/logging.hpp', '${CMAKE_CURRENT_SOURCE_DIR}/resource/logging.hpp.em'])")
159-
string(REPLACE ";" "$<SEMICOLON>" python_code_logging "${python_code_logging}")
160-
add_custom_command(OUTPUT include/rclcpp/logging.hpp
161-
COMMAND ${CMAKE_COMMAND} -E make_directory "include/rclcpp"
162-
COMMAND Python3::Interpreter ARGS -c "${python_code_logging}"
163-
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/logging.hpp.em.watch"
164-
COMMENT "Expanding logging.hpp.em"
165-
VERBATIM
166-
)
167-
list(APPEND ${PROJECT_NAME}_SRCS
168-
include/rclcpp/logging.hpp)
169-
170149
file(GLOB interface_files "include/rclcpp/node_interfaces/node_*_interface.hpp")
171150
foreach(interface_file ${interface_files})
172151
get_filename_component(interface_name ${interface_file} NAME_WE)

rclcpp/Doxyfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ GENERATE_LATEX = NO
2121
ENABLE_PREPROCESSING = YES
2222
MACRO_EXPANSION = YES
2323
EXPAND_ONLY_PREDEF = YES
24+
EXCLUDE_SYMBOLS += RCLCPP_STATIC_ASSERT_LOGGER
25+
EXCLUDE_SYMBOLS += RCLCPP_LOG
26+
EXCLUDE_SYMBOLS += RCLCPP_LOG_ONCE
27+
EXCLUDE_SYMBOLS += RCLCPP_LOG_EXPRESSION
28+
EXCLUDE_SYMBOLS += RCLCPP_LOG_FUNCTION
29+
EXCLUDE_SYMBOLS += RCLCPP_LOG_SKIPFIRST
30+
EXCLUDE_SYMBOLS += RCLCPP_LOG_TIME_POINT_FUNC
31+
EXCLUDE_SYMBOLS += RCLCPP_LOG_THROTTLE
32+
EXCLUDE_SYMBOLS += RCLCPP_LOG_SKIPFIRST_THROTTLE
33+
EXCLUDE_SYMBOLS += RCLCPP_LOG_STREAM
34+
EXCLUDE_SYMBOLS += RCLCPP_LOG_STREAM_ONCE
35+
EXCLUDE_SYMBOLS += RCLCPP_LOG_STREAM_EXPRESSION
36+
EXCLUDE_SYMBOLS += RCLCPP_LOG_STREAM_FUNCTION
37+
EXCLUDE_SYMBOLS += RCLCPP_LOG_STREAM_SKIPFIRST
38+
EXCLUDE_SYMBOLS += RCLCPP_LOG_STREAM_THROTTLE
39+
EXCLUDE_SYMBOLS += RCLCPP_LOG_STREAM_SKIPFIRST_THROTTLE
2440
PREDEFINED += DOXYGEN_ONLY
2541
PREDEFINED += RCLCPP_LOCAL=
2642
PREDEFINED += RCLCPP_PUBLIC=

0 commit comments

Comments
 (0)