utils: Add error checking to log level parsing