Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ron-chang/log-stacker
A colourful and less settings logger, based on built-in package `logging`.
https://github.com/ron-chang/log-stacker
flask logger-backend logging python3 spider
Last synced: 1 day ago
JSON representation
A colourful and less settings logger, based on built-in package `logging`.
- Host: GitHub
- URL: https://github.com/ron-chang/log-stacker
- Owner: Ron-Chang
- License: mit
- Created: 2021-01-25T02:30:35.000Z (almost 4 years ago)
- Default Branch: develop
- Last Pushed: 2021-02-07T08:33:25.000Z (almost 4 years ago)
- Last Synced: 2024-12-21T05:42:17.957Z (1 day ago)
- Topics: flask, logger-backend, logging, python3, spider
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Log Stacker
> A colorful and less settings logger, based on the built-in package `logging`.## What is this?
Contain the following features with the minimum settings.
+ stream logger(Colorful Stream)
+ file logger(strip color tags)
+ remote logger(In progress)## How to use?
### Step 1
- Install
```bash
pip install log_stacker
```- Import module in your entry point at the top
>entry point: startup python file, such as `main.py` `run.py` `start_api.py` etc.
### Step 2
- Basic setup
``` python
"""
start_api.py
"""from log_stacker import LogStacker
LogStacker.logging(__file__)
```or
- Advance setup
``` python
"""
start_api.py
"""from log_stacker import LogStacker
LogStacker.logging(
entry_point='path/to/your/log',
stream_level=LogStacker.WARNING,
file_level=LogStacker.INFO,
remote_level=None
)
```### Step 3
You can start logging in anywhere of your project!
>Note: If you got an initialized warning,
>please make sure you initial LogStacker correctly at the begging of the file your are running.```python
"""
test.py which is called by start_api.py
"""from log_stacker import LogStacker
try:
1/0
except Exception as e:
LogStacker.critical(e)
LogStacker.error(e)
LogStacker.warning(e, msg='It is a warning!')
LogStacker.info('I wanna print something here!')
LogStacker.debug()
```## History
|#| date|version|
|-|----------|-------|
|0|2021/02/07| v0.0.1|#### v0.0.1
- Beta versionIf you like my work, please consider buying me a coffee or [PayPal](https://paypal.me/RonDevStudio?locale.x=zh_TW)
Thanks for your support! Cheers! 🎉