luxe-logg
v1.0.2
Published
Make log styling a little easier
Downloads
3
Readme
luxe-log
Luxe Log
A logger that retains the code location with two features
- 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"))();
Can be combined:
debugFn("and that's why you ", i("always"), " leave a ", u("note!")))();
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")));
- A record of history
import { logHistory } from "luxe-log";
console.log(logHistory);
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.