Log3
Log3 makes it easier to log messages in Python. It comes with a strong default
logging configuration system so you don't configure them yourself.
Here are it's main highlights:
- Easy to use. Just import the module and start using it. This will work for most cases. Unless your logging settings are very specialized you won't have to tinker much with the configuration.
- Strong defaults. The default formatter and date formatter will work for just about anyone. It includes the date, time, filename, level, and message. If you need to use a different formatter you can also do so just as easily.
- New logging methods. In addition to
log.info,log.debug, etclog3also comes withlog.successto log out successful messages - Colored output for terminals. If you're working with the terminal the messages will be colored by default without any additional configuration
- Easier file logging. No need to create a file handler with new date formatting, and formatting and attach to the logger. The same configuration for
STDERRalso applies to the log. Just importlog_to_fileand specify the path of the log as the argument.
Installation
You can install Log3 using pip:
pip install log3
Usage
To start logging it is as simple as importing the log logger object and issuing the logging
commands:
from log3 import log
log.info("Hello world")
log.success("This message was successful")
log.debug("This is a debug message")
log.warning("This is a warning")
log.error("This is an error")
log.critical("This is a critical error")
Log to file
The log_to_file function will allow you to add a file handler to yor logging configuration.
First import it
from log3 import log_to_file
Now you can do:
log_to_file('file')
log.info('logged to file')
Disable logging
You can quickly disable logging rather than hardcoding it into your logging configuration file.
log.disable_logging()
To enable logging again it is also that simple:
log.enable_logging()
Author(s)
- orlandodiaz
Copyright
Copyright (c) 2018 Orlando Diaz
For more info see LICENSE
Metadata
Release files for log3 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| log3-0.1.7.tar.gz | 3.8 kB | Without provenance | Details for log3-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| log3-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for log3-0.1.7-py3-none-any.whl |
Total release size: 9.0 kB
Release files / log3-0.1.7.tar.gz
| Download URL | log3-0.1.7.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ce348300920cac3862c8f87ca4510493e3824e89457ff20b1646f2d2da22a1d
|
|
BLAKE2b-256 checksum How to use checksums |
4e1e5c29e2a929598f48c940101ebde70bdef0eea726594719d89939ebab7e26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1
|
Release files / log3-0.1.7-py3-none-any.whl
| Download URL | log3-0.1.7-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
178afdf58da73d71a2738500d5e05cbb6f4296201e485a22c45ab853cf180c75
|
|
BLAKE2b-256 checksum How to use checksums |
49e6e40cb2618c641b7f3802ca17c15fd53ed9b3a10912a7b93470786cb3f5e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.1
|
Security for log3 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.