Abseil has its own library for logging in Python. It is implemented on top of the standard logging module in Python (described in PEP282), which is good if you’re already familiar with that library. This section mentions the basics of Abseil’s logging library. See the source for more details.
from absl import logging
logging.info('Interesting Stuff') logging.info('Interesting Stuff with Arguments: %d', 42) logging.set_verbosity(logging.INFO) logging.log(logging.DEBUG, 'This will *not* be printed') logging.set_verbosity(logging.DEBUG) logging.log(logging.DEBUG, 'This will be printed') logging.warning('Worrying Stuff') logging.error('Alarming Stuff') logging.fatal('AAAAHHHHH!!!!') # Process exits
vlog(level, msg, *args)