Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakeroggenbuck/mongofastlogger
A simple and fask logging library that uses the power of mongodb to save and query logs (with built in cli)
https://github.com/jakeroggenbuck/mongofastlogger
cli mongodb pip
Last synced: about 2 months ago
JSON representation
A simple and fask logging library that uses the power of mongodb to save and query logs (with built in cli)
- Host: GitHub
- URL: https://github.com/jakeroggenbuck/mongofastlogger
- Owner: JakeRoggenbuck
- License: mit
- Created: 2020-09-27T04:16:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-16T02:33:03.000Z (almost 4 years ago)
- Last Synced: 2024-10-12T23:11:13.460Z (3 months ago)
- Topics: cli, mongodb, pip
- Language: Python
- Homepage: https://pypi.org/project/mongofastlogger/
- Size: 34.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Version](https://img.shields.io/pypi/v/mongofastlogger)
# Logger
A simple and fask logging library that uses the power of mongodb to save and query logs (with built in cli)## Cli
```sh
# search
search
mongofastlogger search Info# clear
clear
mongofastlogger clear# log
log
mongofastlogger log Info "This is a log message"# view
view
mongofastlogger view# export
export
mongofastlogger export filename.log# last
last
mongofastlogger last hours 3# help
find commands
python3 mongofastloggerhelp with specific commands
mongofastlogger command --help# other info
is optional and is 'logs' by default
```## Library
```py
from mongofastlogger import LogViewer, Logger# Make logger
logger = Logger()
# Log message with tag of "Something"
logger.log("Something", "This is bad as well i guess but i dont actually know")
# Log message with tag of "Something" and display log in console
logger.log("Something", "This is a message", display=True)# Make Viewer
viewer = LogViewer()
# Print all logs
viewer.view_log()# Search logs that have the tag "Something"
viewer.search_logs_by_tag("Something")
# Search logs in the last 3 days
viewer.check_by_time("days", 3)
# Export logs to example.log
viewer.export_log("example.log")print("Production")
# Make logger with name
production_logger = Logger("Production")
production_logger.log("Error", "Critical error in production")# Make viewer with name
production_viewer = LogViewer("Production")
production_viewer.view_log()
```### Todo
Make readme more easy to read, especially comments in code and command line instructions
Make last use "amount metric" format because it is more intuitive
Make last have more time metrics, like month and year
Make actual docs for how to use this and its commands, and cli