GithubHelp home page GithubHelp logo

logger's Introduction

Logger

  • 基於logging模組再封裝

  • 已設置基本config

  • 快速上手使用

Import Module

import sys
sys.path.append('logger')
import logger.logging as log

Get Started

logger = log.Logging('test')
logger = run()

Print Message

# print log message
logger.debug_msg('debug message')
logger.info_msg('info message')
logger.warn_msg('warn message')
logger.error_msg('error message')
logger.critical_msg('critical message')

Methods

  1. Logging實例
class Logging(logger_name)
  • logger_name:此logger的名字

  1. run():設置相關config並運行
def run(log_path=None)
  • log_path:輸出log的檔案位置,默認使用logger_name為檔案名稱
  1. 打印不同層級的訊息
def debug_msg('debug message')
def info_msg('info message')
def warn_msg('warn message')
def error_msg('error message')
def critical_msg('critical message')

logger's People

Contributors

music1353 avatar

Watchers

 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.