https://github.com/peterbenoit/consoul.js
Consoul.js is your personal console logging superhero. π¦ΈββοΈ Whether you're debugging or trying to track how your code runs, Consoul.js takes ordinary logging and transforms it into a fully equipped, feature-packed experience.
https://github.com/peterbenoit/consoul.js
console fancy logging styled
Last synced: 12 days ago
JSON representation
Consoul.js is your personal console logging superhero. π¦ΈββοΈ Whether you're debugging or trying to track how your code runs, Consoul.js takes ordinary logging and transforms it into a fully equipped, feature-packed experience.
- Host: GitHub
- URL: https://github.com/peterbenoit/consoul.js
- Owner: peterbenoit
- License: mit
- Created: 2024-09-29T20:14:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-29T20:35:13.000Z (over 1 year ago)
- Last Synced: 2026-05-13T10:49:32.933Z (about 1 month ago)
- Topics: console, fancy, logging, styled
- Language: JavaScript
- Homepage: https://codepen.io/peterbenoit/pen/abevWMz
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Consoul.js Documentation
## What is **Consoul.js**?
**Consoul.js** is your personal console logging superhero. π¦ΈββοΈ Whether you're debugging or trying to track how your code runs, **Consoul.js** takes ordinary logging and transforms it into a fully equipped, feature-packed experience. From log levels to styling, log history, and even browser output, **Consoul.js** has you covered!
### Why use **Consoul.js**?
Logging in JavaScript is so much more than just `console.log("Hello World")`. Hereβs why **Consoul.js** can level up your logging game:
- **π Custom Log Levels:** Control what gets logged based on importance. Set it to DEBUG, INFO, WARN, or ERROR and see just the logs you need.
- **π¨ Styled Logs:** Want to add a little flair to your logs? Customize them with icons and styles (e.g., β
for success, β οΈ for warnings, β for errors).
- **π Log History & Count:** Keep track of every log made during your session. Need to look back on what happened? **Consoul.js** has you covered with a full log history and the total log count.
- **β± Performance Monitoring:** Easily benchmark your code by measuring how long functions take to run. Perfect for tracking down bottlenecks and optimizing performance.
---
### π Installation
Just clone this repo and start using it! π
---
### π Usage Examples
```javascript
// Enable browser output (optional)
consoul.setBrowserOutput(true, '#custom-console');
// Log messages at different levels
consoul.log("This is a standard log message.");
consoul.debug("This is a debug message.");
consoul.warn("This is a warning message.");
consoul.error("This is an error message.");
// Fancy logging
consoul.fancylog("Fancy log message with custom styling!", "Additional details here.");
// Benchmarking example
consoul.benchmark(() => {
// Code you want to measure
}, "Performance Test");
```
Additional advanced features can be found on [Codepen](https://codepen.io/peterbenoit/pen/abevWMz "Codepen") π
---
### π― Key Features
- **Log Levels**: Filter logs by severity.
- **Styled Logs**: Add icons and colors to make logs pop.
- **Log History**: Keep track of all log messages and retrieve them when needed.
- **Conditional Logging**: Log only when a specific condition is met.
- **Function Benchmarking**: Time how long a function takes to execute.
---
### π§βπ» Contribution
Feel free to contribute to **Consoul.js**! Fork the repo, create a branch, and submit a PR with improvements or bug fixes. We welcome your awesome ideas.
---
### License
**Consoul.js** is open-source and licensed under the MIT License.