use a try/catch when setting log level