Promote loglevel to a top-of-script variable