zcubbs / log

A versatile Go logging wrapper that allows seamless integration and toggling between various logging libraries such as Logrus, Zap, Charmlog and the standard log package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Log

A versatile Go logging wrapper that allows seamless integration and toggling between various logging libraries such as Logrus, Zap, Charmlog and the standard log package. It also supports different logging formats like JSON and text, making it a flexible choice for various application needs.

tag Go Version GoDoc Lint Scan Build Status Go Report Card Contributors License

Installation

To install the LogWrapper package, run the following command:

go get github.com/zcubbs/log

Usage

Here is a simple example demonstrating the usage of LogWrapper with different logging types and formats:

package main

import (
    "github.com/zcubbs/log"
    "github.com/zcubbs/log/structuredlogger"
)

func main() {
    log.Info("This is an info message in JSON format")

    log.SetFormat(structuredlogger.TextFormat)
    log.Info("This is an info message in text format")
}

For a more comprehensive example, please refer to example.go in this repository.

Supported Loggers

Supported Formats

  • JSON
  • Text (Human-Readable)

Contributing

We welcome contributions from the community! Feel free to open issues for bug reports or feature requests, and submit pull requests for improvements to the codebase.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A versatile Go logging wrapper that allows seamless integration and toggling between various logging libraries such as Logrus, Zap, Charmlog and the standard log package.

License:MIT License


Languages

Language:Go 100.0%