Skip to main content

This python library allows you to easily create logs for your code.

Project description

BitLogs

Version 1.0.1

This python library allows you to easily create logs for your code.

Installation instructions

  1. Open up your terminal
  2. Run pip install bitlogs
  3. Import it to your project (import bitlogs)

Example code

Code:

from bitlogs import Logger
from bitlogs.message_types.debug_message import DebugMessage

Logger.log(DebugMessage(), "Hello world!")

Output:

[DEBUG] Hello world!

Code:

from bitlogs import Logger
from bitlogs.message_types.critical_message import CriticalMessage


def add(a, b):
    if (not isinstance(a, float)) or (not isinstance(a, float)):
        Logger.log(CriticalMessage(), "A and B have to be of the type float.")
        # you should probably raise an error here
    return a + b

add(1, 2)

Output:

[CRITICAL] A and B have to be of the type float.

from bitlogs import Logger
from bitlogs.message_types.debug_message import DebugMessage

Logger.log_to_file(DebugMessage(), "Hello world!", "example.bitlog")

You can display the content of the file by running: cat example.bitlog on macOS + Linux and type example.bitlog on Windows

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

bitlogs-1.0.1.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file bitlogs-1.0.1.tar.gz.

File metadata

  • Download URL: bitlogs-1.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6

File hashes

Hashes for bitlogs-1.0.1.tar.gz
Algorithm Hash digest
SHA256 040c2873c9628b8872344f3d6afd47a27ef638e5ee39bc078428fe77511f7f17
MD5 4dd39b941f21609d3b43d4f0bb278f0f
BLAKE2b-256 73b2d60b1e3b57bdfb945847ced15be7e7a278c047c077bd778893307d261dbc

See more details on using hashes here.

Supported by

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