When log_level is the string name you can use `getattr(mozlog, log_level.upper())` to obtain the integer.