/ale

Advanced Logging Engine

Primary LanguageGoMIT LicenseMIT

Advanced Logging Engine (ALE)

ale-final-min

A simple yet very powerful logging package great for quick projects and scaling your log collection design.

image

How to Install

go get -u github.com/seanmmitchell/ale/v2

How to Use

import (
    "github.com/seanmmitchell/ale/v2"
    "github.com/seanmmitchell/ale/v2/pconsole"
)

func main() {
    le := ale.CreateLogEngine("Example")
    pCTX, _ := pconsole.New(20, 20)
    le.AddLogPipeline(ale.Info, pCTX.Log)

    le.Log(ale.Critical, "Critical Log")
    le.Log(ale.Error, "Error Log")
    le.Log(ale.Warning, "Warning Log")
    le.Log(ale.Info, "Info Log")
    le.Log(ale.Verbose, "Verbose Log")
    le.Log(ale.Debug, "Debug Log")

    sle := le.CreateSubEngine("Sub-Engine")
    sle.AddLogPipeline(ale.Warning, pCTX.Log)

    sle.Log(ale.Critical, "Critical Log")
    sle.Log(ale.Error, "Error Log")
    sle.Log(ale.Warning, "Warning Log")
    sle.Log(ale.Info, "Info Log")
    sle.Log(ale.Verbose, "Verbose Log")
    sle.Log(ale.Debug, "Debug Log")
}

image

License

This work is licensed under the MIT License.
Please review LICENSE (LICENSE.md) for specifics.