Skip to main content
https://img.shields.io/pypi/v/smoothlogging.svg

Effortless logging to both file and console with automatic timestamped filenames.

Features

  • Simple API for configurable logging to file and console

  • Automatic timestamped log files (myapp_20240326143022.log)

  • Consistent log formatting across your application

  • Full Python 3.7+ support

  • Type hints for better IDE support

  • Proper error handling and validation

Installation

pip install smoothlogging

Quick Start

Using the convenience function:

from smoothlogging import get_logger

logger = get_logger("/var/log/myapp", "myapp")
logger.info("Application started")
logger.warning("Something unexpected happened")
logger.error("An error occurred")

Using the SmoothLogging class:

from smoothlogging import SmoothLogging
import logging

smooth = SmoothLogging()
logger = smooth.get_logger("/var/log/myapp", "myapp", level=logging.DEBUG)

# Log to file and console (default)
logger.info("Message with file and console output")

# Create another logger without console output
file_only = smooth.get_logger("/var/log/myapp", "file-only", console=False)

API Reference

get_logger(log_dir, name, level=logging.DEBUG, console=True)

Convenience function to create and configure a logger.

  • log_dir: Directory for log files (created if doesn’t exist)

  • name: Logger and log file prefix name

  • level: Logging level (default: DEBUG)

  • console: Enable console output (default: True)

  • Returns: Configured logger instance

SmoothLogging.get_logger(…)

Class method with same parameters as convenience function.

SmoothLogging.get_existing_logger(name)

Retrieve a previously created logger by name. - Returns: Logger instance or None if not found

# CI/CD Fixed

Release files for smoothlogging 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smoothlogging 1.0.0
File Size Uploaded
smoothlogging-1.0.0.tar.gz 58.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smoothlogging 1.0.0
File Interpreter ABI Platform
smoothlogging-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 64.1 kB

Release files / smoothlogging-1.0.0.tar.gz

Download URL smoothlogging-1.0.0.tar.gz
Size 58.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9f88525f6d0a80edb89d6b5d04cf934a43d5a258d3a1ac7f847052612e502b2b
BLAKE2b-256 checksum
How to use checksums
c431d6bf5741616a309f0fd8654532bb815a8958d4b0d57dcd1a8b59d601ec55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / smoothlogging-1.0.0-py2.py3-none-any.whl

Download URL smoothlogging-1.0.0-py2.py3-none-any.whl
Size 5.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ee892e5fadc739d636946a7a0438201f70e232213cc7962eeed8de6712655611
BLAKE2b-256 checksum
How to use checksums
7a7105657ef6c1c56e735a1e552003e687441bc0d2eb7e33feca47fb5e1d42b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page