I use Log4Cxx for logging, and I would like to use the% l directive to see where the log trace is located (file name and line number). The problem is that I also use CMake, which provides full path names for the compiler . This causes the log columns to no longer align, and is now difficult to read because log4cxx uses the __FILE__ preprocessor macro to determine this information.
Does anyone know of a workaround? I would like to indicate, for example, how to get only "filename.cpp" or better with a nesting parameter, for example, 2 nesting will be "module / submodule / filename.cpp". It seems that the CMake design works with the complete philosophy of the path, so I think that this could be solved either with the help of a preprocessor directive unknown to me, or somehow trick Log4CXX.
source
share