Skip to content

A high-performance, feature-rich logging library for Go with deduplication, audio PCM/WAV logging, graceful shutdown, and comprehensive configuration.

License

Notifications You must be signed in to change notification settings

LastBotInc/coralie-logging-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coralie-logging-go

A high-performance, feature-rich logging library for Go with deduplication, audio PCM/WAV logging, graceful shutdown, and comprehensive configuration.

Quick Start

package main

import (
    "context"
    "github.com/LastBotInc/coralie-logging-go/pkg/clog"
)

func main() {
    cfg := clog.DefaultConfig()
    cfg.Console.Enabled = true
    cfg.File.BaseDir = "./logs"
    
    clog.Init(cfg)
    defer clog.Shutdown(context.Background())
    
    clog.Info("Application", "Server starting on port 8080")
    clog.Success("Application", "Server started successfully")
    clog.Error("Application", "Connection failed: %v", err)
}

Installation

go get github.com/LastBotInc/coralie-logging-go

Features

  • Multiple log levels: Debug, Info, Success, Warning, Fail, Error, Catastrophe
  • Deduplication: Automatically collapses consecutive identical log lines
  • File routing: Write different levels to different files
  • Console output: Colorized, TTY-aware console logging
  • Audio logging: Write PCM16 audio frames to WAV files
  • Graceful shutdown: Drains queue, flushes all sinks, handles signals
  • Hooks: Global and per-level hooks for custom processing
  • Performance: Bounded queues, drop policies, minimal allocations

Examples

See EXAMPLES.md for a complete list of examples.

Run the demo:

go run ./cmd/coralie-logging-demo

Documentation

Comprehensive documentation is available in the Documents/ directory:

License

MIT License - see LICENSE file.

About

A high-performance, feature-rich logging library for Go with deduplication, audio PCM/WAV logging, graceful shutdown, and comprehensive configuration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages