Skip to content

MattFloyd/luxe-log

Repository files navigation

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.

About

Luxe Log

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •