commit | 05c000a8ad6517dfe1c066f3f00cc01edf1b4ab1 | [log] [tgz] |
---|---|---|
author | Yilei Yang <yileiyang@google.com> | Thu Aug 01 13:43:21 2019 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Aug 01 13:43:39 2019 -0700 |
tree | b81c5eaff2ebbbb7d49f927d4aa6237dccdf788a | |
parent | b80c74fb6a95992e0af4b698ac9c9f822e050788 [diff] |
Stop modifying `logging.root.handlers` when importing `absl.logging`. Users who (indirectly) import `absl.logging` and don't use `absl.app.run()` will no longer have this side-effect, and `absl.logging` behaves like a good citizen. For `absl.app.run()` users: this has behavior changes for log calls between "absl.logging is first imported" and "app.run()" is called, a.k.a. "logs at import time". Logs at import time now have the format like: WARNING:root:import time logs coming from standard `logging` or: WARNING:absl:import time logs coming from `absl.logging` instead of: W0719 14:52:00.084659 8465 other_lib.py:4] import time logs coming from either standard `logging` or `absl.logging` And it no longer warns "WARNING: Logging before flag parsing goes to stderr." If you need the previous behavior for logs at import time, you can call `absl.logging.use_absl_handler()` before importing any other module. PiperOrigin-RevId: 261188705 Change-Id: I09331d22c95cf52ce8485a6372664b3c1ddd3445
This repository is a collection of Python library code for building Python applications. The code is collected from Google's own Python code base, and has been extensively tested and used in production.
To install the package, simply run:
pip install absl-py
Or install from source:
python setup.py install
To run Abseil tests, you can clone the git repo and run bazel:
git clone https://github.com/abseil/abseil-py.git cd abseil-py bazel test absl/...
Please refer to smoke_tests/sample_app.py as an example to get started.
See the Abseil Python Developer Guide.
The current repository includes an initial set of libraries for early adoption. More components and interoperability with Abseil C++ Common Libraries will come in future releases.
The Abseil Python library is licensed under the terms of the Apache license. See LICENSE for more information.