Skip to main content

A minimal logger and web server

Project description

ML3Log

A minimal Python logging package that provides both console logging and a web interface to view logs.

Features

  • Standard Python logger compatible
  • Web server for viewing logs in real-time
  • Minimal footprint with no external dependencies
  • Configurable port (default: 6020)
  • Monkey patching support for standard logging module

Installation

pip install ml3log

Usage

Starting the server

import ml3log

# Start the server on the default port (6020)
ml3log.start_server()

# Or specify a custom port
ml3log.start_server(port=8080)

Using the logger

import ml3log
import logging

# Get a logger with default settings
logger = ml3log.get_logger("my_app")

# Or customize the logger
logger = ml3log.get_logger(
    name="my_app",
    level=logging.DEBUG,
    host="localhost",
    port=6020
)

# Alternatively, monkey patch the standard logging module
# to capture logs from libraries using standard logging
ml3log.monkey_patch_logging()

# Use like a standard Python logger
logger.info("This is an info message")
logger.warning("This is a warning")
logger.error("This is an error")
logger.debug("This is a debug message")

# Log exceptions
try:
    1/0
except Exception as e:
    logger.exception("An error occurred")

Viewing logs

Open your browser and navigate to:

http://localhost:6020

The web interface will automatically update with new logs as they arrive.

License

MIT

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

ml3log-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

ml3log-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ml3log-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for ml3log-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e5c9778c13d7c3511a27eb931bb1d182a1a650e622bdc8b5147c45c3d6a31ef6
MD5 2b277d3a7fad011f91d80ee9a8fb8da8
BLAKE2b-256 e4af5749002746285c34bc95a466df3b8184c2f7c2940eae80b13e8cdadd72ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ml3log-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for ml3log-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 093f6381f12348f43cfc479239e48cdf3a6a07ed6f0c500e24ae7ff7101cfaf5
MD5 3a964beffb5c4259a76c82cf092e26c2
BLAKE2b-256 ae2d3579b539b127d5c9ef790b4ee128480f8a042d1a4b5a92af5c060ddbf5c4

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