Giter Site home page Giter Site logo

ibird-logger's Introduction

ibird-logger

ibird的基础日志插件,使用winston作为底层日志引擎。

安装

npm install ibird-logger

引用

const app = require('ibird').newApp();
const logger = require('ibird-logger');

app.import(logger);

插件信息

  • 命名空间 - ibird-logger
  • 引用参数
    • logDir - 可选,字符串类型,日志存放目录
    • transports - 可选,数组类型,覆盖默认的transports
    • exceptionHandlers - 可选,数组类型,覆盖默认的exceptionHandlers
    • formatter - 可选,函数类型,日志输出格式化函数,传入info参数
    • logOpts - 可选,对象类型,覆盖默认的所有日志设置
  • API
    • info(msg) - 同winston.info函数
    • error(msg) - 同winston.error函数
    • warn(msg) - 同winston.warn函数
    • verbose(msg) - 同winston.verbose函数
    • debug(msg) - 同winston.debug函数
    • silly(msg) - 同winston.silly函数

注意

插件初始化成功,日志对象会以loggerkey更新到应用配置中,如有需要,可通过app.c().logger获取winston的日志对象。

ibird-logger's People

Watchers

James Cloos avatar Daniel Yin 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.