Skip to content

Latest commit

 

History

History
88 lines (80 loc) · 2.69 KB

README.md

File metadata and controls

88 lines (80 loc) · 2.69 KB

this is a beautiful node.js log library

  1. you can git clone https://github.com/XavierJava/log.git this libray in your project,

    in this log you can get which file and line and log time

  2. const { dump, error, info, warn, celebr } = require('log/index.js');

  3. log number

/**
 * log number
 */
info("log number");
dump(123);
error(123);
info(123);
warn(123);
celebr(123);

image.png

  1. log string
/**
 * log string
 */
info("log string");
dump("abc");
error("def");
info("abc");
warn("123123");
celebr("098765");

image.png

  1. log array
/**
 * log array
 */
info("log array");
dump(["abc"]);
error(["def"]);
info(["abc"]);
warn(["123123"]);
celebr(["098765"]);

image.png

  1. log json
/**
 * log json 
 */
info("log json");
void function() {
    dump(["abc"],{
        "a":"1312312312312312312123123"
    });
    error(["abc"],{
        "a":"1312312312312312312123123",
        "b":"1312312312312312312123123123123123123123123"
    });
    info(["abc"],{
        "a":"1312312312312312312123123"
    });
    warn(["abc"],{
        "a":"1312312312312312312123123"
    });
    celebr(["abc"],{
        "a":"1312312312312312312123123"
    });
}();

image.png

  1. log error
/**
 * log error
 */
info("log error");
void function() {
    error(new Error(),new Error());
}();

image.png