Have ideas to improve npm?Join in the discussion! »

    @voliware/logger

    1.5.3 • Public • Published

    logger

    Probably the simplest logger out there.

    How to Use it

    let logger = new Logger("App", {
       level: Logger.level.debug,
       timestamp: {
           state: true,
           format: Logger.timestamp.utc
       },
       output: {
          console: true,
          // node only
          file: './log.txt'
       }
    });
    
    // prints to the console
    // [Mon, 01 Jul 2019 23:41:04 GMT] [DBG] [App] Initializing
    logger.debug("Initializing"); 

    API

    logger.verbose("verbose log");
    logger.debug("debug log");
    logger.info("info log");
    logger.warning("warning log");
    logger.error("error log");
    logger.log("hello", "debug");
    logger.log("hello again", Logger.level.debug);
    logger.disable();
    logger.enable();
    logger.setLevel("info");

    Node

    Install with node package manager

    npm install @voliware/logger

    Include in a file

    const Logger = require('@voliware/logger');

    Browser

    Include in a file

    <script src="https://cdn.jsdelivr.net/npm/@voliware/logger/dist/logger.min.js"></script>

    Install

    npm i @voliware/logger

    DownloadsWeekly Downloads

    4

    Version

    1.5.3

    License

    MIT

    Unpacked Size

    28.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • avatar