New news! Go log library goookit/slog has released version v0.5.1
gookit/slog is an easy-to-use, lightweight, configurable, and extensible log library. Supports multiple levels and outputs to multiple files; built-in file log processing, automatic cutting, cleaning, compression and other enhanced functions.
- Github github.com/gookit/slog
##Console log effect:
- Simple, no configuration required, ready to use out of the box
- Supports commonly used log level processing
- For example:
- trace
You can arbitrarily expand what you need - trace
- Handler
- at the same time Handler
Log processing, output logs to different places
Support custom construction - Handler
Processor
- Built-in
- handler.Config
, you can quickly and easily build the desired log processor
Support customization - handler.Config
- Formatter
Format processing
- Built-in
- json
Two log record formatting
Formatter
Commonly used log processors have been built-in - json
- console
Output logs to the console, support color output
- writer
Output logs to the specified
io.Writer - file
Output the log to the specified file, optionally enable
bufferBuffered writing
- simple
Output the log to the specified file, Write the file directly without buffering
- rotate_file
Output the log to the specified file, and support splitting the file by time and size. It is enabled by default
bufferBuffered writing
Please check the ./handler folder for more built-in implementations
- console
- Support enabling
- buffer
Buffered log writing
Supports automatic splitting of files by time and size - Supports configuration of compressed log files through
- gzip
- BackupNum
For more usage, please see
v0.5.1 Update log
Update- ⚡ perf: Optimize the performance of processing log message data
- ? up: Update some code logic And add more unit tests
- ✅ test: Update benchmark test and update readme
- ? break: Rename some interfaces and structures
- ✨ feat: handler - Configure new fields LevelMode, Level
- ✨ feat: Add more fast configuration methods for handler.Builder
- doc: Update readme Document and add more usage examples
- ⬆️ dep: Update related dependent tool libraries to the latest version
Recommended learning: "go video tutorial》
The above is the detailed content of New news! Go log library goookit/slog has released version v0.5.1. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The library used for floating-point number operation in Go language introduces how to ensure the accuracy is...

Queue threading problem in Go crawler Colly explores the problem of using the Colly crawler library in Go language, developers often encounter problems with threads and request queues. �...

The problem of using RedisStream to implement message queues in Go language is using Go language and Redis...

The difference between string printing in Go language: The difference in the effect of using Println and string() functions is in Go...

What should I do if the custom structure labels in GoLand are not displayed? When using GoLand for Go language development, many developers will encounter custom structure tags...

Which libraries in Go are developed by large companies or well-known open source projects? When programming in Go, developers often encounter some common needs, ...

Two ways to define structures in Go language: the difference between var and type keywords. When defining structures, Go language often sees two different ways of writing: First...

When using sql.Open, why doesn’t the DSN report an error? In Go language, sql.Open...
