metovlogs is a very simple logging library

Overview

metovlogs

Dead simple Python logging.

metovlogs is a very simple logging library. Setup is one line, then you can use it as a drop-in print replacement. Sane and useful log format out of the box. Best for small or early projects.

Usage

Initialize the logger by calling get_log:

import metovlogs

# The name will be used to annotate the log
# __name__ is name of the current Python module
log = metovlogs.get_log(__name__)

Now you can use it as a drop-in replacement for all your prints:

# Do some stuff
log.info("Finished doing some stuff")

log.debug("About to start doing other stuff")
# Do some other stuff

metovlogs is like black for logs: You get reasonable behavior by default and no customization beyond that. This allows you to focus on developing without distraction. If you want to tweak your logs, you should use something else.

Installation

pip install metovlogs

Further reading

You might also like...
Robust and effective logging for Python 2 and 3.
Robust and effective logging for Python 2 and 3.

Robust and effective logging for Python 2 and 3.

Python logging package for easy reproducible experimenting in research

smilelogging Python logging package for easy reproducible experimenting in research. Why you may need this package This project is meant to provide an

Small toolkit for python multiprocessing logging to file

Small Toolkit for Python Multiprocessing Logging This is a small toolkit for solving unsafe python mutliprocess logging (file logging and rotation) In

Logging system for the TPC software.

tpc_logger Logging system for the TPC software. The TPC Logger class provides a singleton for logging information within C++ code or in the python API

A Python package which supports global logfmt formatted logging.

Python Logfmter A Python package which supports global logfmt formatted logging. Install $ pip install logfmter Usage Before integrating this library,

ClusterMonitor - a very simple python script which monitors and records the CPU and RAM consumption of submitted cluster jobs
ClusterMonitor - a very simple python script which monitors and records the CPU and RAM consumption of submitted cluster jobs

ClusterMonitor A very simple python script which monitors and records the CPU and RAM consumption of submitted cluster jobs. Usage To start recording

A new kind of Progress Bar, with real time throughput, eta and very cool animations!
A new kind of Progress Bar, with real time throughput, eta and very cool animations!

alive-progress :) A new kind of Progress Bar, with real-time throughput, eta and very cool animations! Ever found yourself in a remote ssh session, do

A very basic esp32-based logic analyzer capable of sampling digital signals at up to ~3.2MHz.
A very basic esp32-based logic analyzer capable of sampling digital signals at up to ~3.2MHz.

A very basic esp32-based logic analyzer capable of sampling digital signals at up to ~3.2MHz.

This open-source python3 script is a builder to the very popular token logger that is on my github that many people use.
This open-source python3 script is a builder to the very popular token logger that is on my github that many people use.

Discord-Logger-Builder This open-source python3 script is a builder to the very popular token logger that is on my github that many people use. This i

Comments
  • Support setting log level with Python parameter, document

    Support setting log level with Python parameter, document

    Adds some more control over log levels.

    You can now pass a parameter to get_log (gets overridden by the envar). Rationale: Although the idea is to minimize customization and target early stage programs, I am now happily using metovlogs in quite a few of my own projects that are mature enough to need more control over log levels. Yet metovlogs is otherwise adequate. So instead of taking my own advice to "set up proper logging", I'll give in to scope creep 😛. In my defense, as scope creeps go, this one is quite small and innocent 👼.

    Setting the constant was already possible, but I decided to document it. Right now, every Python file must do log = get_log("log_name"). If you want to use the parameter, you would have to pass the same value every time. It can get tedious if there are many files in your program. On the other hand, the constant can be set once in your main __init__.py and it nicely applies to the whole package, and it can still be overwritten by individual files (by passing the parameter to get_log) and by the user (by setting the envar).

    Mutating the constant does sound weird, but then again it's not _DEFAULT_LEVEL so seems fair game. And also no constants in Python anyways 🤷.

    opened by metov 0
Owner
Azat Akhmetov
Data Engineer, Biologist, Python enthusiast & tinkerer.
Azat Akhmetov
Simple and versatile logging library for python 3.6 above

Simple and versatile logging library for python 3.6 above

Miguel 1 Nov 23, 2022
A basic logging library for Python.

log.py ?? About: A basic logging library for Python with the capability to: save to files. have custom formats. have custom levels. be used instantiat

Sebastiaan Bij 1 Jan 19, 2022
A lightweight logging library for python applications

cakelog a lightweight logging library for python applications This is a very small logging library to make logging in python easy and simple. config o

null 2 Jan 5, 2022
Python logging made (stupidly) simple

Loguru is a library which aims to bring enjoyable logging in Python. Did you ever feel lazy about configuring a logger and used print() instead?... I

null 13.7k Jan 2, 2023
Beautifully colored, quick and simple Python logging

Python Quick Logging | QLogging Beautifully colored, quick and simple Python logging. This logger is based on Python logging package Screenshots: Term

null 45 Sep 25, 2022
Structured Logging for Python

structlog makes logging in Python faster, less painful, and more powerful by adding structure to your log entries. It's up to you whether you want str

Hynek Schlawack 2.3k Jan 5, 2023
A colored formatter for the python logging module

Log formatting with colors! colorlog.ColoredFormatter is a formatter for use with Python's logging module that outputs records using terminal colors.

Sam Clements 778 Dec 26, 2022
Colored terminal output for Python's logging module

coloredlogs: Colored terminal output for Python's logging module The coloredlogs package enables colored terminal output for Python's logging module.

Peter Odding 496 Dec 30, 2022
A cool logging replacement for Python.

Welcome to Logbook Travis AppVeyor Supported Versions Latest Version Test Coverage Logbook is a nice logging replacement. It should be easy to setup,

null 1.4k Nov 11, 2022
Stand-alone parser for User Access Logging from Server 2012 and newer systems

KStrike Stand-alone parser for User Access Logging from Server 2012 and newer systems BriMor Labs KStrike This script will parse data from the User Ac

BriMor Labs 69 Nov 1, 2022