Browse Source

debug statements only show filename

main
Stefan Pranger 3 years ago
parent
commit
67aaef771f
  1. 2
      CMakeLists.txt
  2. 5
      io/debug.h

2
CMakeLists.txt

@ -6,6 +6,8 @@ include_directories(${PROJECT_SOURCE_DIR}
) )
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/thirdparty/SQLiteCpp) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/thirdparty/SQLiteCpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILENAME__='\"$(notdir $(abspath $@))\"'")
add_executable(notification-daemon add_executable(notification-daemon
calendar-daemon.cpp calendar-daemon.cpp

5
io/debug.h

@ -13,8 +13,9 @@ struct X {
#endif #endif
}; };
#define DEBUG (X(), std::cout << "DEBUG[" << __FILE__ << ":" << __LINE__ << " in " << __func__ << "()]: ")
#define WARN (X(), std::cout << "WARN [" << __FILE__ << ":" << __LINE__ << " in " << __func__ << "()]: ")
#define DEBUG (X(), std::cout << "DEBUG[" << __FILENAME__ << ":" << __LINE__ << " in " << __func__ << "()]: ")
#define WARN (X(), std::cout << "WARN [" << __FILENAME__ << ":" << __LINE__ << " in " << __func__ << "()]: ")
#ifdef LOG_DEBUG #ifdef LOG_DEBUG
#define STEP \ #define STEP \

Loading…
Cancel
Save