- Notifications
You must be signed in to change notification settings - Fork0
A library with no dependencies to handle and amplify the use of console.log and other forms of debugging
License
NotificationsYou must be signed in to change notification settings
vacom/logbook
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A simple library with no dependencies, which uses console.log but better looks and functionality in a simple API
Just install the dependency and start using
npmi @vacom/logbookoryarnadd @vacom/logbook
After installing the dependency, just import the components you need
importLogfrom"@vacom/logbook";
importLogfrom"@vacom/logbook";//Simple usage//args: ValueLog.info("Any value, object or data type");/** STYLES **///args: Title, Value, ColorLog.color("title","value","#2274A5");/** STATES **///args: ValueLog.warn("This is a warning");Log.error("This is a error");Log.success("This is a success");Log.time("This is a time log");/** DATA **///Table//args: Value: ArrayLog.table([{id:1,name:"john"},{id:2,name:"Jack"}]);//Simple GroupLog.group.title("A group").child("Child").end();//Nested GroupLog.group.title("A group").child("Child").title("Nested group").child("nested child").end().end();/** SEQUENCE **///Trace//show how the code ended up at a certain point//args: ValueLog.trace("trace");//Assert//args: Condition, Value//Write a message to the console, only if the first argument is _false_Log.assert(document.getElementById("demo"),"You have no element with ID 'demo'");//Countfor(i=0;i<10;i++){Log.count();}/** UTILITIES **/Log.clear();//Clears everything in the console
MIT ©vacom