A simple and fask logging library that uses the power of mongodb to save and query logs (with built in cli)
Project description
Logger
A simple and fask logging library that uses the power of mongodb to save and query logs (with built in cli)
Cli
search
search <tag>
python3 runner.py search Info
clear
clear
python3 runner.py clear
log
log <tag> <message>
python3 runner.py log Info "This is a log message"
view
view
python3 runner.py view
export
export <filename>
python3 runner.py export filename.log
last
last <metric> <amount>
python3 runner.py last hours 3
help
find commands
python3 runner.py
help with specific commands
python3 runner.py command --help
Library
from mongofastlogger.logger 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()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mongofastlogger-0.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for mongofastlogger-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcc824cf9d5e542221d4c17006b4ceae2d7cbba3ef435c8e87dab5919abf5561 |
|
MD5 | 2799c9ae5b1af69b710ebfd8d4782ec5 |
|
BLAKE2b-256 | 1423a67fbb696506a0ecf622dcb1b39fe02099d6644577a50794cb9459981f15 |