Skip to main content

A simple logger package for Jupyter Notebooks

Project description

ou-logger-py

Simple logger for use in Jupyter notebooks.

This package sets up the Pyhton logger for immediate use in a Jupyter notebook setting.

Install as: pip install ou-logger

Usage:

# Variously:
from ou_logger import logger
from ou_logger import logger, set_handler
from ou_logger import *

Importing the logger will display an information message:

Logger enabled. Set level as: logger.setLevel(LEVEL), where LEVEL is one of: DEBUG, INFO, WARNING, ERROR (default), CRITICAL.
Set text and/or text-to-speech output: set_handler('text, tts')
Usage: e.g. logger.error('This is an error message')

Logging messages will be displayed at or above the declared logging level. For example:

  • logger(CRITICAL) will only display CRITICAL messages;
  • logger(WARNING) will display WARNING, ERROR and CRITICAL messages.

By default, messages will be displayed as text:

Example of logger message displayed on a pink background as notebook streeamed output

Text to speech messages

Logged messages can also be spoken aloud using the browser text-to-speech (TTS) engine.

Enable text and/or TTS output by setting:

set_handler("text")
set_handler("text, tts")
set_handler("tts")

DEVELOPMENT

Build as: python -m build .

Push to PyPi as: twine upload dist/ou_logger*0.0.2*

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

ou_logger-0.0.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

ou_logger-0.0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file ou_logger-0.0.2.tar.gz.

File metadata

  • Download URL: ou_logger-0.0.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.0

File hashes

Hashes for ou_logger-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e0436c0f0a7c939145e04486eb825b96cfea4b50785b0a398ccc10ed5f4e1c48
MD5 e753c08712e45d20b4863daf61cf4e53
BLAKE2b-256 a4f1cfba1931b2e5f915a5600532453e235761881c4e413f3d4e680101cb108b

See more details on using hashes here.

File details

Details for the file ou_logger-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ou_logger-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.0

File hashes

Hashes for ou_logger-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b28131f9f9e293e9da04b535aeeefa23d0649cf6f6106a2deb327f2ba25a1937
MD5 0dafa088801086b1dd7f327e41396f1a
BLAKE2b-256 39d4c7849a387aa2a8d578e413e635fbd618e73c873197684c60164f83389afd

See more details on using hashes here.

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