Added a static helper function to turn logging off/set the logging level.