I have a Python script using https://abseil.io/docs/python/guides/logging.
Documentation does not specify how to set output file like in PEP 282.
I thought that Abseil Logging is built on top of the standard Python logging and I could just set the logging.basicConfig(filename='myapp.log', level=logging.INFO)
But I get:
AttributeError: module 'absl.logging' has no attribute 'basicConfig'
You can set it via the command line:
See the (limited) flag documentation by running
--helpfulland looking at the absl.logging module.You can also change it in code (somewhat convolutedly) by calling:
This will print something like
/whatever/py_<myprog>.<hostname>.log.INFO.<ts>. Note that this also creates a friendlier symlink for your latest run that's just/whatever/py_<myprog>.INFO.