Skip to main content

Provide a function for anyone who want to configure log parameters easily, just call init_log_config when your app start up, the you can use the module of logging which build-in python3 without any other configtur. This module support ConsoleHandler, RotatingFileHandler and SMTPHandler and You can change the configuration parameters according to your requirements.

Project description

Provide a function for anyone who want to configure log parameters easily, just call init_log_config when your app start up, the you can use the module of logging which build-in python3 without any other configtur. This module support ConsoleHandler, RotatingFileHandler and SMTPHandler and You can change the configuration parameters according to your requirements.

Meta

[![Version](https://img.shields.io/pypi/v/log_config.svg)](https://pypi.python.org/pypi/log_config) [![GitHub](https://github.com/wcadaydayup/log_config.svg?branch=master)](https://github.com/wcadaydayup/log_config)

Installation

Simply run the following from within a virtualenv:

$ pip install log_config

or

$ pip install git+https://github.com/wcadaydayup/log_config

Usage

Import the log config function in anywhere you want use logging which build-in Python3:

from log_config.log_config import init_log_config

Call init_log_config() when your application start up, of course you can modify log file path, log level and so on by import other variable from log_config.log_config:

init_log_config()

Log confiture is ready, you can use logging module without any other configture:

import logging
    logger = logging.getLogger()
    logger.debug("this is a message of debug level.")

Then, you will see you output message in console and log file which in your current directory:

configure_installed_apps_logger(logging.INFO, verbose=True, filename='django-project.log')

You can also receive email notify if call init_log_config(use_mail=True), of course you should provide correct email parameters:

    import log_config.log_config as lf
    lf.EMAIL_HOST = "xxx.smtp.com"
    lf.FROM = "youraccount@xx.com"
    lf.TO = "a@xx.com;b@xx.com"

    ...

init_log_config(use_mail=True)

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

log_config-1.9.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

log_config-1.9-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file log_config-1.9.tar.gz.

File metadata

  • Download URL: log_config-1.9.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for log_config-1.9.tar.gz
Algorithm Hash digest
SHA256 da74d005b38d2ea269df3a6ffc0ae39c429b2d2045d16b518030a1bd4623bf82
MD5 e0c57c068e071ab26e558280e3f064d6
BLAKE2b-256 70cf3a9fb014609418c08721f6663db87ea97ed0662762b69b0c6372c2e21c98

See more details on using hashes here.

File details

Details for the file log_config-1.9-py2.py3-none-any.whl.

File metadata

  • Download URL: log_config-1.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for log_config-1.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 31f3efb7ce099e338e08d589e70b9f300ff491c310fd9fb77ba6d8ebf8bc5b74
MD5 c5ab64377ef86e19c4dbfc807c59a80d
BLAKE2b-256 d84a2b036beab1fb244e3d2d21e3f929e085cf4c9fc83b3c4aca94146911f2b9

See more details on using hashes here.

Supported by

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