Skip to content

Small Javascript library to color and organize your console.log in Google Chrome !

License

Notifications You must be signed in to change notification settings

CVarisco/CLog.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLog.js

Small (3 KB) Javascript library to color and organize your console.log in Google Chrome !

Why should I use it ?

If you frequently use the console.log function in your projects, it might become tricky or confusing to read the log and find exactly what you're looking for at the first glance. With my library you can now color code and organize your output by sections (eg. home, login, etc...) or type (eg. log, error, etc...) so you can easily find exactly what you're looking for in a matter of seconds

How to install

Download from Bower or npm.

npm install clog_js
bower install clog

How to use CLog.

It's very simple to use. Declare a new CLog object with its options.

var options = {
    group: false,            // The console.group mode of Google Chrome is set to false by default
    colors: {               // Define the color. (Default color: Black)
        log: "#31f095",
        home: "#e86024",
        error: "#e22f2f",
        network: "#08bce9",
    }
}

var CLog = new CLog(options);

When you want to log with CLog, use the .log() method.

// The first argument need to be a color. 
CLog.log('log', 'String log', 12345, 'Another String', { id: '1234'}, ['a','b', 'c'], true, false);

//If you want, you can declare directly an hexadecimal 
CLog.log('#52361f', parameters...);

If the first argument isn't a color ( id or hex ), it uses the default color which is black.

Versioning

CLog.js is maintained under the Semantic Versioning guidelines.

License

This software is released under MIT license terms.


Have fun coding!

About

Small Javascript library to color and organize your console.log in Google Chrome !

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published