JSPM

@find_bumblebee/fox-log

0.5.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • 0
    • Score
      100M100P100Q27892F
    • License ISC

    fox log

    Package Exports

    • @find_bumblebee/fox-log
    • @find_bumblebee/fox-log/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@find_bumblebee/fox-log) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    主要由 Logger 和 Transport 两个基类组成。

    Transport 是一种写入日志的渠道,可以是终端、文件等等。

    Logger 是所有日志的基类,可以进行扩展。一个 Logger 可以添加多个 Transport,只要调用一次就可以将日志写入多个地方。

    const Logger = require('@find_bumblebee/fox-log').FoxLogger;
    
    const logger =  new Logger({
      dir:__dirname,
      file: "fox.log",
      encoding: 'utf8',
      level: 'DEBUG',
      consoleLevel: 'DEBUG',
      buffer: false,
      outputJSON: false,
      jsonFile: '',
    });
    
    logger.debug('12345 wyz foo'); 
    logger.tag('test').debug('12345 wyz foo'); 
    logger.tag('Test').debug('12345 wyz foo'); 
    logger.tag(111).debug('12345 wyz foo'); 
    logger.tag({"test":1}).debug('12345 wyz foo');