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.19.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.19-py2-none-any.whl (4.2 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: duallog-0.19.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.19.tar.gz
Algorithm Hash digest
SHA256 770480768b47e34abc3e2654a75436798a2f6035391b142251ef18bc3d7b181f
MD5 90398ece7e62a37226e4493f7d3d8958
BLAKE2b-256 f9052d0aefd20489259d18ae22aea3e196a148e290f4885a7b095fd25141a4b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duallog-0.19-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.19-py2-none-any.whl
Algorithm Hash digest
SHA256 2b8b3274e8ec9802af94b8da2621bf9c2e3b5294dffb41ced93d8e6a0aa3c47b
MD5 bd66c139f06064cb938ee54519127d93
BLAKE2b-256 f2eae2ae6849dba3553b0a70d5a3f419e881f1547a9af339f727d0790c2381dc

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