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.

How to install duallog?

To install the duallog package, perform the following two steps:

  1. Download and unpack this repository.
  2. From within the repository folder, run python setup.py install.

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.warn('This function illustrates how to use the duallog package.')
logging.warn('All messages are sent to both the console and a logfile in the folder \"{}\".'.format(logdir))
logging.warn('The logfile\'s name encodes the time when the program was started.')
logging.warn('The duallog package treats different log levels differently.')
logging.debug('Debug messages like this are written to the logfile, but not printed on screen.')
logging.info('Info messages like this get the same treatment.')
logging.warn('Warn messages like this one are important. They are both sent to the logfile and shown on screen.')
logging.error('The same holds for error messages like this one ...')
logging.critical('... and for critical messages, of course.')
logging.warn('Have a look at the debug and info messages the logfile in the folder \"{}\".'.format(logdir))
logging.warn('They are not sent to the screen in order not to clutter the display.')

The corresponding output on the console and in the logfile looks like this:

Duallog screenshot

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.11.tar.gz (3.3 kB view details)

Uploaded Source

Built Distributions

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

duallog-0.11-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

duallog-0.11-py2-none-any.whl (4.5 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: duallog-0.11.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.9.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

File hashes

Hashes for duallog-0.11.tar.gz
Algorithm Hash digest
SHA256 df765342e8cbede2a05092f68836c7cf07933681dc483706d7685773b1c7de14
MD5 4c5a7a8faad7fa8bf249e8d558a28bc3
BLAKE2b-256 7b393be96ff925d9c2ad2408afb2711a03dd5cc41d4cc6d33047e5da7afefdad

See more details on using hashes here.

File details

Details for the file duallog-0.11-py3-none-any.whl.

File metadata

  • Download URL: duallog-0.11-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.9.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

File hashes

Hashes for duallog-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 c019b864a0edc91688a98c3d175d4d04cd5fb0bcf14af76eabaa577565d379fe
MD5 1a586ea12d6287380c39ddd14a3fa4e8
BLAKE2b-256 2202a5d18a7af429d914d5a014891a71522e5ea4a4e1bebf983117e7f1b3b0a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duallog-0.11-py2-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.9.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

File hashes

Hashes for duallog-0.11-py2-none-any.whl
Algorithm Hash digest
SHA256 c5f41a8f2324cdda53dfae9d4c720bd629eb98c85775251ee9a191bd1590e4d2
MD5 42f7c15b7d89cecbfcca9f00a55d1d1a
BLAKE2b-256 f84fc94f2d9b7b822f84e693e985f82828ca0a7dc20ba01a501dc5dbe7d691ac

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