Skip to main content

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> <logger_name>
python3 runner.py search Info

clear

clear <logger_name>
python3 runner.py clear

log

log <tag> <message> <logger_name>
python3 runner.py log Info "This is a log message"

view

view <logger_name>
python3 runner.py view

export

export <filename> <logger_name>
python3 runner.py export filename.log

last

last <metric> <amount> <logger_name>
python3 runner.py last hours 3

help

find commands
python3 runner.py
help with specific commands
python3 runner.py command --help

other info

<logger_name> is optional and is logs by default

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.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

mongofastlogger-0.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file mongofastlogger-0.2.tar.gz.

File metadata

  • Download URL: mongofastlogger-0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/50.3.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.8.5

File hashes

Hashes for mongofastlogger-0.2.tar.gz
Algorithm Hash digest
SHA256 59dce1b44d5fb1a1e0608ad74eeca7b0f16e08a289c75f43a244ff5f7914a2e7
MD5 19da2160235f62bfd1af221391f814f8
BLAKE2b-256 df27106ed14c543555bcb43bd690ffaf1bb0d424e475717348dffd6a2b535ec9

See more details on using hashes here.

Provenance

File details

Details for the file mongofastlogger-0.2-py3-none-any.whl.

File metadata

  • Download URL: mongofastlogger-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/50.3.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.8.5

File hashes

Hashes for mongofastlogger-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5210097383e99e4027be766f6d97617f3b2d51421030cdb69fe5f927ea514125
MD5 5502cc87ca5095c17dafdd7dea54278f
BLAKE2b-256 c6cb970c1040e57ab32fd91dbe303c5e7bd0f83977454ff1f2f7092a34fb56c3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page