refine logging/debug output control