log101
Version:
Color the console with simple light weight npm package
71 lines (49 loc) âĸ 2.36 kB
Markdown
# đ Console Logger Utility
A đ ī¸ simple and đ¨ customizable logging utility for styled đĨī¸ console messages. This utility provides predefined styles for different log đ levels (e.g., `âšī¸ info`, `â ī¸ warning`, `đ¨ danger`, `â error`, `â
success`) and allows full đ ī¸ customization for additional ⥠flexibility.
## đĨ Installation
Install the đĻ package via npm:
```bash
npm install log101
```
## đąī¸ Usage
Import the package into your đĨī¸ project:
```javascript
import log from "log101";
```
### đ Logging with Predefined Styles
```javascript
// â
Default style (đĸ green, đĸ bold, đ large text)
log("This is a default message");
// đ¨ Predefined styles for log đ levels
log("âšī¸ Information message", "info"); // đĩ Blue text for âšī¸ informational logs
log("â ī¸ Warning message", "warning"); // đ Orange text for â ī¸ warnings
log("đ¨ Critical issue detected!", "danger"); // đ´ Red text for đ¨ critical issues
log("â An error occurred!", "error"); // đ Dark đ´ red text for â errors
log("â
Operation was successful!", "success"); // đĸ Green text for â
success
```
### đ ī¸ Logging with Custom Styles
You can pass a đ¨ custom style object to override the predefined styles:
```javascript
log("đī¸ Custom styled message", {
color: "#FF5733",
fontSize: "18px",
fontWeight: "normal",
fontStyle: "italic"
});
```
### đ¨ Predefined Styles
| Style | đ Description |
|------------|--------------------------------------------------|
| `default` | đĸ Green, đĸ bold, đ xx-large text |
| `info` | đĩ Blue, đĩ bold, đ large text |
| `warning` | đ Orange, đ bold, đ large text |
| `danger` | đ´ Red, đ´ bold, đ large text |
| `error` | đ Dark đ´ red, đ bold, đ large text |
| `success` | đĸ Green, đĸ bold, đ large text |
### đ¨ Dynamic CSS String
You can also pass a âī¸ raw CSS string if you prefer:
```javascript
log("đŽ Direct CSS example", "color:purple;font-size:24px;font-weight:bold;text-decoration:underline");
```
## đ License
This project is licensed under the âī¸ MIT License.