
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
logging2
Advanced tools
A More Pythonic Logging System; or, You Deserve Better Than log4j
.. image:: https://travis-ci.org/vforgione/logging2.svg?branch=master :target: https://travis-ci.org/vforgione/logging2 .. image:: https://coveralls.io/repos/github/vforgione/logging2/badge.svg?branch=master :target: https://coveralls.io/github/vforgione/logging2?branch=master .. image:: https://readthedocs.org/projects/logging2/badge/?version=latest :target: http://logging2.readthedocs.io/en/latest/?badge=latest
Logging should be simple and intuitive.
For most use cases, you want to quickly instantiate a logger and dump some text to a stream. You would expect a common workflow based on a minimum level of verbosity in the log entries and for those entries to be formatted in some fashion that is both human readable and machine parseable. There should also be a set of common metadata that can be used to provide context to the entry.
That context should also be easily extended to suit everyone's use cases. Additionally, the values passed to that context should be pliable - users should have the option to override those values as they deem necessary.
Common meta information should conform to as widely adopted standards as possible - i.e. ISO 8601 timestamps and full unicode supported messages.
As stated foremost, the interface to this system should be simple and intuitive. This means the complexity of the system should be minimized, configuration should have sane defaults and the supporting library should be packed with expressive documentation.
The user should only be concerned with three components:
LogLevel)Handler)Logger)logging2 is available through PyPI, and thus can be installed via pip::
$ pip install logging2
Logging should be simple and intuitive. With that in mind, the easiest way to get up and running is
to instantiate a Logger and start producing entries::
from logging2 import Logger
logger = Logger('app') logger.info('Hello, world!') 2017-04-29T17:08:23.156795+00:00 INFO app: Hello, world!
The default logger will dump all log entries to STDOUT with a minimum verbosity of info.
There are numerous configurations, all with simple and easy to rationalize behavior:
Logger s have a handful of ways of creating log entries via:
debug for the most verbose level of messagesinfo for typical informational messageswarning for calling user attention to a potentially hazardous conditionserror for altering users to captured and recovered from error conditionsexception for capturing exception tracebacks in the logThe mechanism for producing the log entries to the output streams is via Handler s. Handlers
are broken into three groups:
streaming for common IO messaging (typically STDOUT and STDERR)files for file system based IOsockets for network based messagingAll of which are found in the logging2.handlers package.
This logging utility is designed for Python 3.6 and better. It will not be backported to support any earlier versions of Python.
FAQs
A More Pythonic Logging System
We found that logging2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.