Better log file format for visualizer

All or nothing is not very good for debug, so now we use a bitmask for _DEBUG (defined in global.h)

Also a fix for a compilation issue...