Home > Backend Development > Golang > New news! Go log library goookit/slog has released version v0.5.1

New news! Go log library goookit/slog has released version v0.5.1

藏色散人
Release: 2023-04-17 14:34:01
forward
819 people have browsed it

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.

##Console log effect:

New news! Go log library goookit/slog has released version v0.5.1

Function introduction

    Simple, no configuration required, ready to use out of the box
  • Supports commonly used log level processing
    • For example:
    • trace debug info notice warn error fatal panic
  • You can arbitrarily expand what you need
  • Handler Formatter
  • Supports adding multiple
  • at the same time Handler Log processing, output logs to different places
  • Support custom construction
  • Handler Processor
      Built-in
    • handler.Config handler.Builder, you can quickly and easily build the desired log processor
  • Support customization
  • Formatter Format processing
      Built-in
    • json text Two log record formattingFormatter
  • Commonly used log processors have been built-in
    • 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 buffer Buffered 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 defaultbuffer Buffered writing
    • Please check the ./handler folder for more built-in implementations
Output log to file

    Support enabling
  • buffer Buffered log writing
  • Supports automatic splitting of files by time and size
  • Supports configuration of compressed log files through
  • gzip
  • Supports cleaning of old logs File configuration:
  • BackupNum BackupTime
For more usage, please see

README

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
Other

    ✅ test: Update benchmark test and update readme
v0.5.0 update log

Changes

    ? break: Rename some interfaces and structures
New features

    ✨ feat: handler - Configure new fields LevelMode, Level
  • ✨ feat: Add more fast configuration methods for handler.Builder
Others

    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!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template