Giter Site home page Giter Site logo

python_logging's Introduction

python_logging

A python package to streamline logging for current and future Python projects. It is capable of generating up to 4 handlers:

  • A console handler
  • A file handler
  • A modified file handler that names the log the current date
  • A modified buffering handler that emails the logs to a specified email The package is built and tested in Python 3.6.

Package Dependencies

  • logging
  • configparser
  • smtplib (if using the Email Handler)
  • email (if using the Email Handler)
  • datetime (if using the File Date Handler)
  • unipath (if using the File Date Handler)

Usage

The python_logging folder contains all the needed files to output a logging object. Simply import the python_logging package and create a logging object and run the start function. A config file can be passed in to specify the loaded handlers. If no config file is passed in, the log will default to a console handler.

import python_logging
import configparser

config = configparser.ConfigParser()
config.read("\home\user\my_config_file.cfg")

log = python_logging.start(config)

log.info("This is a test of the log")
> 00:00:00 - INFO      This is a test of the log

Testing

The package_test.py can be used to confirm the module and handlers are working properly. You will need to update the config location to a correct directory to test this part out.

python_logging's People

Watchers

Study Buffalo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.