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.png)
[Duallog screenshot](https://github.com/acschaefer/duallog/blob/master/duallog_screenshot.png)

## How to install duallog?

You can install duallog using [pip](https://www.w3schools.com/python/python_pip.asp), 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.

```python
# 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.16.tar.gz (3.0 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.16-py2.7.egg (5.1 kB view details)

Uploaded Egg

duallog-0.16-py2-none-any.whl (4.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: duallog-0.16.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.2.1 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.5.3 Linux/4.14.79+

File hashes

Hashes for duallog-0.16.tar.gz
Algorithm Hash digest
SHA256 57db01eb558cb85e97660d70c17359c9a51ed38a3e8799083bb5419606d1e675
MD5 7646f697e597d4ba7c29d2d8ce93067f
BLAKE2b-256 ff2ee77fa0db1c9df111c2ed00e75e0a2e44c563dd6c551710e0ac01b5163e4b

See more details on using hashes here.

File details

Details for the file duallog-0.16-py2.7.egg.

File metadata

  • Download URL: duallog-0.16-py2.7.egg
  • Upload date:
  • Size: 5.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.2.1 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.5.3 Linux/4.14.79+

File hashes

Hashes for duallog-0.16-py2.7.egg
Algorithm Hash digest
SHA256 7f2eba7d18b2dfac6c926c2ba29f2e4c601d09a49791da6d6fd342d26e8abb81
MD5 d950e52c9d60f9eab0a3235c50075265
BLAKE2b-256 964575e9c484ea07e043358f20a24da800b3d4e2077314cb6555fa719f2a3ce5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: duallog-0.16-py2-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.2.1 requests/2.12.4 setuptools/33.1.1 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.5.3 Linux/4.14.79+

File hashes

Hashes for duallog-0.16-py2-none-any.whl
Algorithm Hash digest
SHA256 a0e9dfca44e05d02b8a3afceff90043f7a1ed7c27048fa20e8f4c6aa7334fe1b
MD5 346aed7c69f9ae22504dcf583974a96e
BLAKE2b-256 516022ed6ba73a389c884717685bb15aa7297141e0c54459aa409a505948b90d

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