microsoft/picologging

Support passing a string to `setLevel`.

Closed this issue · 0 comments

For compatibility purposes with the stlib and other logging libraries it would be great if logger.setLevel would support setting the logging levels via strings instead of constants.

import logging
import picologging

stdlib_logger = logging.getLogger()
stdlib_logger.setLevel("DEBUG")  # this works

pico_logger = picologging.getLogger()
pico_logger.setLevel("DEBUG")  # this does not work