{"repo":"charmbracelet/log","free":true,"listed":false,"github":"https://github.com/charmbracelet/log","clone":"git clone https://github.com/charmbracelet/log.git","description":"A minimal, colorful Go logging library 🪵","language":"Go","stars":3362,"topics":["golang","logging"],"license":"MIT","category":"analytics","readme_excerpt":"Log A minimal and colorful Go logging library. 🪵 It provides a leveled structured human readable logger with a small API. Unlike [standard log ][stdlog], the Charm logger provides customizable colorful human readable logging with batteries included. - Uses [Lip Gloss][lipgloss] to style and colorize the output. - Colorful, human readable format. - Ability to customize the time stamp format. - Skips caller frames and marks function as helpers. - Leveled logging. - Text, JSON, and Logfmt formatters. - Store and retrieve logger in and from context. - Slog handler. - Standard log adapter. Usage Use go get to download the dependency. Then, import it in your Go files: The Charm logger comes with a global package-wise logger with timestamps turned on, and the logging level set to info . All logging levels accept optional key/value pairs to be printed along with a message. You can use log.Print() to print messages without a level prefix. New loggers Use New() to create new loggers. Levels Log offers multiple levels to filter your logs on. Available levels are: Use log.SetLevel() to set the log level. You can also create a new logger with a specific log level using log.Options{Level: } . Use the corresponding function to log a message: Or use the formatter variant: Structured All the functions above take a message and key-value pairs of anything. The message can also be of type any. Options You can customize the logger with options. Use log.NewWithOptions() and log.Options{} to custo","default_branch":null,"files":null,"tree":[],"storefront":"/r/charmbracelet","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/charmbracelet/log/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}