awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
charmbracelet avatar

charmbracelet/log

0
View on GitHub↗
3,121 星标·87 分支·Go·mit·9 次浏览

Log

This is a structured logging library designed to produce logs using key-value pairs, severity levels, and machine-readable formats. It provides a toolkit for creating logs that are consistent for both human review and machine parsing.

The project is distinguished by its focus on terminal visualization, using a styling system to apply colors and prefixes to log entries for improved readability in consoles. It also includes a specialized adapter to convert standard library log calls into structured events by inferring severity levels from message prefixes.

The library manages metadata through contextual sub-loggers that attach persistent attributes and automatic source location information to entries. It supports multiple serialization formats, including JSON and logfmt, and provides source attribution by analyzing the call stack to identify the origin of log events.

The system integrates with the standard slog package via a custom handler to route structured logs through its formatting engine.

Features

  • Structured Logging - Implements structured logging by recording operational data as machine-readable key-value pairs.
  • Log Formatters - Provides pluggable formatters to serialize structured logs into multiple formats including JSON and logfmt.
  • Logfmt Serializers - Serializes log entries into key-value pairs following the logfmt standard to handle complex data types.
  • Terminal Output Stylers - Applies visual styles and color-coded escape sequences to log output for improved console readability.
  • Structured Logging Libraries - Provides a comprehensive toolkit for producing structured logs with key-value pairs and severity levels.
  • Persistent Log Context - Attaches persistent metadata fields to logger instances to ensure consistent context across all subsequent logs.
  • JSON Formats - Serializes log entries into machine-readable JSON and logfmt formats for observability tool compatibility.
  • Severity Level Filtering - Filters log messages based on a minimum severity threshold such as Info or Error.
  • Contextual Logging - Injects persistent metadata and source location information into log entries to enable system-wide tracing.
  • Log Configuration - Provides global settings for controlling log severity levels, time formats, and output prefixes.
  • Logger Hierarchies - Implements hierarchical logger structures where child loggers inherit metadata and attributes from their parents.
  • Contextual Logger Instances - Provides a logging system capable of creating child loggers that carry persistent, scoped metadata.
  • Structured Log Field Attachments - Allows adding structured key-value pairs to log entries to provide consistent context throughout an execution.
  • Log Level Visual Styling - Maps specific log levels to visual color profiles and formatting rules for improved terminal readability.
  • Log Metadata Injectors - Automatically injects constant fields, timestamps, and source location information into every emitted log entry.
  • Logfmt Serializers - Includes a dedicated serializer for converting structured log data into the logfmt standard.
  • Runtime Call-Stack Capturers - Analyzes the runtime call stack to bypass wrapper functions and identify the original source of a log event.
  • Standard Library Adapters - Wraps standard library logging interfaces to integrate them into a structured logging pipeline.
  • Logging Libraries - Provides adapters that convert standard library log calls into structured events to modernize legacy logging.
  • Adapter Patterns - Uses adapter patterns to bridge the gap between standard library logging and structured logging interfaces.
  • Custom Log Formatting - Supports converting structured log data into multiple interchangeable formats including text, JSON, and logfmt.
  • Source Location Capture - Automatically records the source file, line number, and function name for every emitted log entry.
  • Severity Inference Engines - Infers log severity levels from unstructured strings by matching message prefixes against defined patterns.
  • Component Identifiers - Allows prepending specific strings to log entries to identify which component emitted the message.
  • Logging Integrations - Implements a custom handler for the standard slog package to route structured logs through its formatting engine.

Star 历史

charmbracelet/log 的 Star 历史图表charmbracelet/log 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Log 的开源替代方案

相似的开源项目,按与 Log 的功能重合度排序。
  • sirupsen/logrussirupsen 的头像

    sirupsen/logrus

    25,736在 GitHub 上查看↗

    Logrus is a structured logging library for Go that produces machine-readable output using key-value pairs and JSON formatting. It serves as a pluggable logging framework providing a thread-safe event logger with configurable mutex locking to manage concurrent writes across multiple goroutines. The project distinguishes itself through a pluggable hook system that routes log entries to external services or custom destinations. It also features a contextual logger capable of attaching persistent metadata and request-scoped fields to entries to improve traceability. The framework covers broad ob

    Gogologginglogrus
    在 GitHub 上查看↗25,736
  • winstonjs/winstonwinstonjs 的头像

    winstonjs/winston

    24,478在 GitHub 上查看↗

    Winston is a versatile logging library for Node.js designed to record system events and metadata. It functions as a multi-transport log manager that routes data to various destinations and a structured log formatter that transforms entries into JSON or plain text. The project is distinguished by its pluggable transport architecture, which decouples the logging interface from delivery mechanisms. This allows for the creation of custom transport extensions and the use of hierarchical logger instances to inherit configurations while attaching persistent metadata to downstream messages. The libr

    JavaScript
    在 GitHub 上查看↗24,478
  • hynek/structloghynek 的头像

    hynek/structlog

    4,835在 GitHub 上查看↗

    structlog is a structured logging library for Python that treats log entries as dictionaries instead of strings. This data-centric approach enables machine-readable output and precise data analysis by generating log entries as key-value pairs. It functions as both a standalone logging framework and a compatibility layer that adds structured capabilities to the Python standard library logging module. The library features a processor-pipeline architecture that passes log dictionaries through a sequence of functions to modify events or add metadata before final rendering. It includes a contextua

    Python
    在 GitHub 上查看↗4,835
  • nlog/nlogNLog 的头像

    NLog/NLog

    6,542在 GitHub 上查看↗

    NLog is an open-source logging framework for .NET that functions as a structured logging library and log routing engine. It captures log events with named parameters as searchable data rather than plain text and directs these messages to various output destinations based on severity and source. The framework is designed as an extensible platform, supporting custom targets, layout renderers, and filters that can be loaded from external assemblies or defined in code. It features a dynamic configuration system that allows logging targets, rules, and layouts to be updated via XML or programmatic

    C#aotaot-compatiblec-sharp
    在 GitHub 上查看↗6,542
查看 Log 的所有 30 个替代方案→

常见问题解答

charmbracelet/log 是做什么的?

This is a structured logging library designed to produce logs using key-value pairs, severity levels, and machine-readable formats. It provides a toolkit for creating logs that are consistent for both human review and machine parsing.

charmbracelet/log 的主要功能有哪些?

charmbracelet/log 的主要功能包括:Structured Logging, Log Formatters, Logfmt Serializers, Terminal Output Stylers, Structured Logging Libraries, Persistent Log Context, JSON Formats, Severity Level Filtering。

charmbracelet/log 有哪些开源替代品?

charmbracelet/log 的开源替代品包括: sirupsen/logrus — Logrus is a structured logging library for Go that produces machine-readable output using key-value pairs and JSON… winstonjs/winston — Winston is a versatile logging library for Node.js designed to record system events and metadata. It functions as a… hynek/structlog — structlog is a structured logging library for Python that treats log entries as dictionaries instead of strings. This… nlog/nlog — NLog is an open-source logging framework for .NET that functions as a structured logging library and log routing… seldaek/monolog — Monolog is a logging library that implements the PSR-3 standard to ensure interoperable log handling across PHP… serilog/serilog — Serilog is a structured logging library for .NET applications that records events as rich data objects instead of…