The duallog package
Python package to enable simultaneous logging to console and logfile.
How to install duallog?
You can install duallog using pip, or you can install from source. Below you find instructions for both ways.
Installation via pip
In the terminal, run pip install duallog.
Installation from source
- Download and unpack this repository.
- Open a terminal and navigate to the repository.
- Execute
python setup.py installfrom within the repository.
How to use duallog?
Using duallog is very simple, as illustrated in the following minimal example script.
# Import the duallog package to set up simultaneous logging to screen and console.
import duallog
# Import the logging package to generate log messages.
import logging
# Set up dual logging and tell duallog where to store the logfiles.
duallog.setup('logtest')
# Generate some log messages.
logging.debug('Debug messages are only sent to the logfile.')
logging.info('Info messages are not shown on the console, too.')
logging.warning('Warnings appear both on the console and in the logfile.')
logging.error('Errors get the same treatment.')
logging.critical('And critical messages, of course.')
The output of this program is shown in the screenshot at the top of this page.
Metadata
Release files for duallog 0.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| duallog-0.20.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| duallog-0.20-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 7.3 kB
Release files / duallog-0.20.tar.gz
| Download URL | duallog-0.20.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b40b15d28df1dcd6ec6e5df343f11b5e5aa1fdbf9c48899a05e6008721ff3b2
|
|
BLAKE2b-256 checksum How to use checksums |
cea90546d33724acd620630782dbc3f1c3ba2bd9df61f2f78dfc7c9e3342ef7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/2.7.15rc1
|
Release files / duallog-0.20-py2-none-any.whl
| Download URL | duallog-0.20-py2-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
3290d68096a999da9a373b13fe47660ae5115fb2d06037d89edd606eba8df014
|
|
BLAKE2b-256 checksum How to use checksums |
dacd64477821155b3e0dc490730783e61b7135d0da947f5d2231bbd32dbf67d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/2.7.15rc1
|