seelog Documentation

repository·master·Indexed 23 days ago

https://github.com/cihub/seelog

A high-performance logging framework for the Go programming language featuring XML-based or code configuration, multiple output streams (Console, File, Buffered, Rolling, and SMTP), and various logger priority strategies for performance optimization.

Tokens
373
Snippets
2
Records
3
Agent score
32%

What's inside seelog

  1. Overview of Seelog features

    master

    Seelog is a logging framework for Go that supports:

    • Flexible Configuration: XML-based configuration that can be changed on the fly without restarting the application. Since v2.6, configuration can also be done via code.
    • Multiple Output Streams: Simultaneous logging to various writers including Console, File, Buffered (Chunk), Rolling (with rotation), and SMTP.
    • Advanced Formatting: Adjustable message formatting and support for log message wrappers like JSON and XML.
    • Performance Optimization: Multiple logger priority strategies (e.g., sync, async loop, async timer, and adaptive) to minimize performance impact.
    • Granular Control: Ability to set different log configurations for specific project files and functions.
  2. Quick-start with Seelog

    master

    For standalone applications, you can use Seelog's global variables and functions. It is important to call log.Flush() (typically via defer) to ensure all buffered log messages are written to their destinations before the application exits.

    package main
    
    import log "github.com/cihub/seelog"
    
    func main() {
        defer log.Flush()
        log.Info("Hello from Seelog!")
    }