Files
Milan Radosavljevic 318d13870f [rocprofiler-systems] Update logging to use spdlog library (#2428)
## Motivation

- Structured logging with proper log levels (TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL)
- Better performance through compile-time formatting
- Consistent formatting using fmt library
- Runtime log level control via arguments and environment variables
- Easier maintenance and debugging capabilities

## Technical Details

- Added spdlog as a submodule and integrated it into CMake build system
- Created new `rocprofiler-systems-logger` library wrapping spdlog functionality
- Replaced custom logging macros (`ROCPROFSYS_VERBOSE`, `ROCPROFSYS_DEBUG`, `ROCPROFSYS_FATAL`, `ROCPROFSYS_REQUIRE`, `ROCPROFSYS_CI_THROW`, etc.) with spdlog equivalents (`LOG_DEBUG`, `LOG_WARNING`, `LOG_CRITICAL`, etc.)
- Implemented log level control through command-line arguments and environment variables
- Converted assertion macros to proper error handling with exceptions and std::abort()
2026-01-14 15:27:51 -05:00

34 regels
984 B
CMake

# ------------------------------------------------------------------------------#
#
# rocprofiler-systems logger library
#
# ------------------------------------------------------------------------------#
add_library(rocprofiler-systems-logger INTERFACE)
add_library(rocprofsys-logger ALIAS rocprofiler-systems-logger)
add_library(
rocprofiler-systems::rocprofiler-systems-logger
ALIAS rocprofiler-systems-logger
)
target_sources(
rocprofiler-systems-logger
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/logger.hpp ${CMAKE_CURRENT_SOURCE_DIR}/debug.hpp
)
get_filename_component(LOGGER_SOURCE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" DIRECTORY)
target_include_directories(
rocprofiler-systems-logger
INTERFACE $<BUILD_INTERFACE:${LOGGER_SOURCE_INCLUDE_DIR}>
)
target_link_libraries(
rocprofiler-systems-logger
INTERFACE $<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-spdlog>
)
if(ROCPROFSYS_BUILD_TESTING)
add_subdirectory(tests)
endif()