Skip to main content

The duallog package

Python package to enable simultaneous logging to console and logfile.

Duallog screenshot

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

  1. Download and unpack this repository.
  2. Open a terminal and navigate to the repository.
  3. Execute python setup.py install from 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)

Source distribution for duallog 0.20
File Size Uploaded
duallog-0.20.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for duallog 0.20
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.20 This release

2 release files

0.19

2 release files

0.17

1 release file

0.16

3 release files

0.15

4 release files

0.14

3 release files

0.13

3 release files

0.12

3 release files

0.11

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page