@azashi/log1

Simple logger

Usage no npm install needed!

<script type="module">
  import azashiLog1 from 'https://cdn.skypack.dev/@azashi/log1';
</script>

README

@azashi/log1

log1 (package) GitHub license npm (version)

Log easily with date-time and string.

Install

npm install @azashi/log1

Usage

Has two methods,

1. log(str,lvl)

Takes string and optional parameter level as input and returns a log statement. If lvl is given as 0 then returns undefined.

2. clog(str,lvl)

Takes string and optional parameter level as input and prints a log on console. If lvl is given as 0 then prints nothing.

 const LogOne = require("@azashi/log1");

 const output = LogOne.log("Print with date-time");

 console.log(output);

 // Mon Nov 25 2019 23:27:15 | Print with date-time

 LogOne.clog("Directly log this");

 // Sat Dec 14 2019 23:27:15 | Directly log this