add enable_debug_msgs to dynamically enable/disable debug logging