Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cvarisco/clog.js
Small Javascript library to color and organize your console.log in Google Chrome !
https://github.com/cvarisco/clog.js
google-chrome javascript-library
Last synced: 3 months ago
JSON representation
Small Javascript library to color and organize your console.log in Google Chrome !
- Host: GitHub
- URL: https://github.com/cvarisco/clog.js
- Owner: CVarisco
- License: mit
- Created: 2016-02-11T19:05:52.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-18T20:59:24.000Z (almost 8 years ago)
- Last Synced: 2024-09-29T17:02:44.468Z (3 months ago)
- Topics: google-chrome, javascript-library
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 32
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```javascript
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.
```javascript
// 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](http://semver.org/).
## License
This software is released under MIT license terms.
---
Have fun coding!