when I run a DPL workflow I don’t manage to see the debug output which should be available from the device. According to the README of the core framework I should be able to set the infologger severity via --infologger-severity DEBUG, but this setting seems to affect only the DPL itself, not the device in question.
So I run: o2-trd-trap-sim -b --infologger-severity debug
and I see debug messages from DPL like
[26543:TRDDIGITREADER]: 2020-12-11 11:27:51.550693 DPL: socket polled UV_WRITEABLE
which are hidden if I don’t set the infologger severity, but from the code which I am interested in (TrapSimulator.cxx) I don’t see debug messages, only [WARN] messages. @swenzel pointed out that I might need to build O2 again without the NDEBUG flag which I did but still I don’t see the log messages I am interested in.
Does anybody know what might be the reason for this?
Hi Jens,
I tried, but maybe I did it wrong…
I removed the NDEBUG flag from the CMAKE_CXX_FLAGS_[RELEASE,RELWITHDEBINFO] in dependencies/O2CompileFlags.cmake. In the same file I furthermore set FAIR_MIN_SEVERITY to debug instead of info.
Or should this be done differently? Can I change the o2 recipe in alidist to enable the debug mode?
Cheers,
Ole
I had a look with my nightly debug build. It seems to me that --infologger-severity debug only enables debug output in the DPL driver and not for the actual processes. @eulisse: What do you think about propagating this flag to the final Logger instances? I think this would be very helpful.
There is actually also a more general --severity flag but that also doesn’t seem to have any effect.
@oschmidt: I am making a dedicated debug O2 package like this:
# copy recipe
cp alidist/o2.sh alidist/o2-debug.sh
# change name of package
sed -i 's/package: O2/package: O2-Debug/' alidist/o2-debug.sh
# insert lines into recipe that make it compile in debug mode
sed -i '/#!\/bin\/sh/ a unset CXXFLAGS && CXXFLAGS="-fPIC -std=c++17" && unset CMAKE_BUILD_TYPE && CMAKE_BUILD_TYPE=Debug' alidist/o2-debug.sh
# make a soft link of O2 git repo to O2-Debug git repo
ln -s O2 O2-Debug
Same for me with o2-trd-trap-sim -b --severity debug. I don’t see any debug messages from the TRAP simulation that I am interested in. @swenzel and @laphecet thanks a lot for providing the information how to build in debug mode!
I found this ticket since I have a similar problem with DEBUG statements. I managed to compile my code with CMAKE_BUILD_TYPE=Debug but I see a strange behaviour when running my tasks with --severity debug option. In particular it seems to depend on the presence/position of “\n”:
LOGF(debug,“test”); // nothing is printed
LOGF(debug,“test\n”); // empty lines are printed
LOGF(debug,"\n test"); // I finally see my debugs