Skip to main content

Parallel logging to console and logfile

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duallog-0.20.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duallog-0.20-py2-none-any.whl (4.2 kB view details)

Uploaded Python 2

File details

Details for the file duallog-0.20.tar.gz.

File metadata

  • Download URL: duallog-0.20.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for duallog-0.20.tar.gz
Algorithm Hash digest
SHA256 8b40b15d28df1dcd6ec6e5df343f11b5e5aa1fdbf9c48899a05e6008721ff3b2
MD5 07537c0294f89528d1ab4dabd134f518
BLAKE2b-256 cea90546d33724acd620630782dbc3f1c3ba2bd9df61f2f78dfc7c9e3342ef7f

See more details on using hashes here.

File details

Details for the file duallog-0.20-py2-none-any.whl.

File metadata

  • Download URL: duallog-0.20-py2-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 2
  • Uploaded using 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

File hashes

Hashes for duallog-0.20-py2-none-any.whl
Algorithm Hash digest
SHA256 3290d68096a999da9a373b13fe47660ae5115fb2d06037d89edd606eba8df014
MD5 f6090a0da6ac465f53bb5039702abafb
BLAKE2b-256 dacd64477821155b3e0dc490730783e61b7135d0da947f5d2231bbd32dbf67d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page