Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ludeeus/colorlog
A simple component to format log output with colors.
https://github.com/ludeeus/colorlog
color format litelement log webcomponent
Last synced: 20 days ago
JSON representation
A simple component to format log output with colors.
- Host: GitHub
- URL: https://github.com/ludeeus/colorlog
- Owner: ludeeus
- License: mit
- Created: 2020-01-19T12:53:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T15:30:12.000Z (over 3 years ago)
- Last Synced: 2024-10-04T20:20:19.718Z (about 1 month ago)
- Topics: color, format, litelement, log, webcomponent
- Language: HTML
- Homepage: https://www.npmjs.com/package/@ludeeus/colorlog
- Size: 99.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Colorlog
[![npm](https://img.shields.io/npm/v/@ludeeus/colorlog?style=for-the-badge)](https://www.npmjs.com/package/@ludeeus/colorlog)
[![npm](https://img.shields.io/badge/demo-live-green?style=for-the-badge)](https://rawcdn.githack.com/ludeeus/colorlog/master/example.html)
[![npm](https://img.shields.io/badge/example-file-blue?style=for-the-badge)](https://github.com/ludeeus/colorlog/blob/master/example.ts)![example](https://raw.githubusercontent.com/ludeeus/colorlog/master/example.png)
A simple component to format log output with colors.
Currently only output from pythons `logging` package is supported.
## Example usage
See [the demo](https://rawcdn.githack.com/ludeeus/colorlog/master/example.html) for examples on how it can look.
See [example.ts](https://github.com/ludeeus/colorlog/blob/master/example.ts) for examples on how you can use it.
```typescript
import "@ludeeus/colorlog";
```## How it works
The component has one property (`log`), here you can feed it a text representation of your output.
It will split the input on newline, and scan each line for a know indicator on what type of log line it is.## CSS vars
| CCS Var | Default |
| ------------------------ | ----------- |
| `--colorlog-font-family` | `monospace` |
| `--colorlog-text` | `#000000` |
| `--colorlog-debug` | `#00b2fd` |
| `--colorlog-info` | `#00ab00` |
| `--colorlog-warning` | `#ffc303` |
| `--colorlog-error` | `#f00000` |
| `--colorlog-critical` | `#d00000` |