commit | c1f5399bb1db321e8fd1c4ba4a2db49710a45059 | [log] [tgz] |
---|---|---|
author | Abseil Team <absl-team@google.com> | Fri May 26 02:34:05 2023 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Dec 13 04:30:42 2023 -0800 |
tree | 2e5b56112b3b63e66f8d247b77ae85dc5898e7be | |
parent | 6929bf0da3b53358176d6f69d9a4c0af099db6a7 [diff] |
Introduces convenient logging functions for usage in loops: The functions with the postfix `_once` only log when they are called for the first time. This is useful when used inside loops while the arguments to be logged do not change. The current alternatives (`logging.info`, `logging.warning`, etc.) can load the log too heavily here. * `log_once(level, msg, *args)` Logs only the first call. (Forwards to `log_first_n`) * `debug_once(msg, *args)` forwards to `log_once`. * `info_once(msg, *args)` forwards to `log_once`. * `warning_once(msg, *args)` forwards to `log_once`. * `error_once(msg, *args)` forwards to `log_once`. * `fatal_once(msg, *args)` forwards to `log_once`. PiperOrigin-RevId: 535561745
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.