Better logging behaviour with gdb