Instead of looking for some cfg values and changing Info, Debug or False Check all cfg values and change as required. Consider how to handle the special case of the Energy Monitor. Suggestion get ride of the Mode = All and turn that on when needed. Also fix the check for mode "Debg"