Refactor setLogLevel()

By moving the no-console-available helper function into `realMethod()`, most of the code in `setLogLevel()` becomes obsolete and `replaceLoggingMethods()` no longer requires any arguments.