← 全部工具

2ning

热度 55 更新于 开发与构建

Colorful and customizable logging module for CLI applications.

pypiauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

Tune your logs

<p align="center" <img src="./docs/logo.png" alt="tuning icon" width=500 </p

tuning is a colorful and customizable dual-logging module for CLI applications. Emojis included 😉.

The idea is simple, display human-readable and colorful terminal logs, while keeping file logs detailed and sober.

It builds on stdlib logging and Rich, so you can use it as usual:

  • logging via named functions: logger.mycustomlvl()
  • natural language defined styles: bold italic white on red

Features

Easy to use

  • Stdlib-like root logger configuration through basicConfig(), including rotating logs.
  • YAML-driven configuration (we got your back with the defaults)

Fully customizable

  • Logging levels: icon, symbol, and style. (already added TRACE and SUCCESS)
  • Colorful console output, with optional information: timestamp and path (caller file).
  • Styled interactive prompts, with default value: logger.prompt(...)
  • Custom app banners through banner(...)
  • Inside-of-the-box: experimental display mode which encloses console records into boxes. Beautiful, but

Optional extras are available for CLI and TUI integrations, but tuning does not wrap Typer or Textual.

Install

pip install 2ning

For local development:

git clone https://github.com/octanima-labs/tuning
cd tuning
pip install -e ".[dev,cli,tui,docs]"

Quick Start

import tuning

logger = tuning.getLogger(__name__)

logger.info("application started")
logger.success("everything looks good")

name = logger.prompt("Your name?")
logger.info("hello %s", name)