Skip to main content

A simple and lightweight logging library

Project description

pip install microlog

microlog

Simple and lightweight logging

Getting started

from microlog import Logger
my_logs = Logger()
my_logs.log("Hello World!")
  • Logs can be created with the following methods
    • log()
    • debug()
    • info()
    • warning()
    • error()
    • critical()
  • Logs from a current session are saved in memory and can be viewed with the logs() method.

Options

There are three options available when creating a new Logger instance.

1. File

By default a log file will not be created when creating a new Logger instance. Set the file parameter to True and a log file will be created in the current directory. You may provide a custom name for the log file by setting the file parameter to a string value.

Logger(file = "my_logs")

Logs are written using the append option so they can be added to existing log files.

2. Console

Log messages will be written to the console by default. Set the console parameter to False to stop seeing log messages in the console.

Logger(console = False)

You can change this status using the console() method.

my_logs.console(False)

3. Time format

All references to time will be local date-time by default. To use a UTC timestamp, set the ts parameter to True. This will apply to default log file names and times in the log files.

Logger(ts = True)

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

microlog-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microlog-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file microlog-0.1.0.tar.gz.

File metadata

  • Download URL: microlog-0.1.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0

File hashes

Hashes for microlog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f5ed0687b27e23a464fa146e9f5fabf1280038f00eaa14efa2d5392178ac902
MD5 967ffa957962e30808480d5829928b92
BLAKE2b-256 7f5934303cb3d74c708f28666bdf58cccc3481e104601a3cc64eac2bd15578f9

See more details on using hashes here.

File details

Details for the file microlog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: microlog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0

File hashes

Hashes for microlog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54b195af163529bfa54097e22bdc76b24dca0525729ac8f8d03df87c5bfa7ec5
MD5 df21f6a1a0b4413000ec9a3b734b5f16
BLAKE2b-256 c7c6fa63b8debd3b7d6f3a0ae8364d2759a7e723099d954378e87a914f40fd9b

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