What does '--log=INFO' mean in Python Logging HOWTO

Viewed 905

I read the Python Logging HOWTO, and there is a description I don't understand:

If you want to set the logging level from a command-line option such as:

--log=INFO

and you have the value of the parameter passed for --log in some variable loglevel, you can use:

getattr(logging, loglevel.upper())

to get the value which you’ll pass to basicConfig() via the level argument.

What does it mean? There is no example, it would be nice if someone could give one.

Can I set the logging level like this?

logging --log=INFO
1 Answers
Related