Skip to main content

The logging init model

Project description

1. install

pip install --user loginit==<version>

2. upgrade

pip install --user -U loginit==<version>   # upgrade

3. uninstall

pip uninstall --user loginit

4. How to use

#!/usr/bin/env python

from loginit import init_logger
import  logging

if __name__ == "__main__":
    import platform
    if platform.system() == "Windows":
        init_logger("C:\\Users\\JXM\Desktop\\test.log")
    elif platform.system() == "Linux":
        init_logger("/tmp/test.log")
    else:
        init_logger()

    logging.info("this is info test !!!")
    logging.debug("this is debug test !!!")
    logging.warning("this is warning test !!!")
    logging.error("this is error test !!!")
    logging.critical("this is critical test !!!")
    try:
        raise Exception("this exception test !!!")
    except Exception as e:
        logging.exception(e)

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

LogInit-1.2.8.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file LogInit-1.2.8.tar.gz.

File metadata

  • Download URL: LogInit-1.2.8.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for LogInit-1.2.8.tar.gz
Algorithm Hash digest
SHA256 62ccb3e81c4d97a84f8bc941153435d1d44e72ad4a57acfbe5ee9a015a1605b7
MD5 080a048ceadc2e613a50505eb38b81d2
BLAKE2b-256 ccb1bd3fed97949713c3481f72f63a10d1d3403c4ca56e26641cdf7bb3e8ba5b

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