@4a/asp
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    asp

    染色日志,推荐配合iTerm使用,非标准日志模块,方便日志聚焦

    Install

    npm i @4a/asp
    yarn add @4a/asp

    Usage

    const { asp } = require('@4a/asp')
    // or
    import asp from '@4a/asp'
    // or
    import { asp, Asp } from '@4a/asp'
    asp.gray('message', { app: '@4a/asp' })
    asp.log('message', { app: '@4a/asp' })
    asp.info('message', { app: '@4a/asp' })
    asp.debug('message', { app: '@4a/asp' })
    asp.warn('message', { app: '@4a/asp' })
    asp.error('message', { app: '@4a/asp' })
    
    // pretty once
    asp.pretty().error('message', { app: '@4a/asp' })

    Preview

    @4a/asp:preview

    class Asp

    // pretty anywhere
    const asp = new Asp({ pretty: true })

    Level

    分级显示

    Level=0 node app.js # only error
    Level=1 node app.js # warn, error
    Level=2 node app.js # debug, warn, error
    Level=3 node app.js # info, debug, warn, error
    Level=4 node app.js # log, info, debug, warn, error
    Level=5 node app.js # all

    level

    enum Level {
        error,
        warn,
        debug,
        info,
        log,
        gray,
    }

    Example

    node example/demo.js

    Install

    npm i @4a/asp

    DownloadsWeekly Downloads

    27

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    9.31 kB

    Total Files

    6

    Last publish

    Collaborators

    • gavinning