luxe-logg
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

luxe-log

Luxe Log

A logger that retains the code location with two features

  1. Easy styling
import { debugFn, infoFn, warnFn, errorFn, b, u, i, strike } from "luxe-log";

debugFn("Logged in user: ", b("Gob Bluth"))();

infoFn("Logged in user: ", u("Gob Bluth"))();

warnFn("Logged in user: ", i("Gob Bluth"))();

errorFn("Logged in user: ", strike("Gob Bluth"))(); 

image

Can be combined:

debugFn("and that's why you ", i("always"), " leave a ", u("note!")))();

image

Alternate syntax:

import { debug, info, warn, error, b, u, i, strike } from "luxe-log";

console.debug(...debug("Logged in user: ", b("Gob Bluth"));

console.info(...info("Logged in user: ", u("Gob Bluth")));

console.warn(...warn("Logged in user: ", i("Gob Bluth")));

console.error(...error("Logged in user: ", strike("Gob Bluth")));
  1. A record of history
import { logHistory } from "luxe-log";
console.log(logHistory);

image

Notes:

If you need to log an object so that it still expands in the console, but can add to the logHistory object, you can use console.logObj

To set the limit for log history, use setLogLimit. Default is 200.

Readme

Keywords

none

Package Sidebar

Install

npm i luxe-logg

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

43.8 kB

Total Files

5

Last publish

Collaborators

  • mattfloyd