Categorygithub.com/danielgatis/go-logrus-adapters
modulepackage
0.0.0-20250123020639-48551491b18b
Repository: https://github.com/danielgatis/go-logrus-adapters.git
Documentation: pkg.go.dev

# README

Go - Logrus Adapters

Go Report Card License MIT Go Doc

A collection of adapters for logrus pkg.

Install

go get -u github.com/danielgatis/go-logrus-adapters

And then import the package in your code:

import "github.com/danielgatis/go-logrus-adapters"

Example

package main

import (
	"net/http"

	adapters "github.com/danielgatis/go-logrus-adapters"
	"github.com/labstack/echo/v4"
	"github.com/sirupsen/logrus"
)

func main() {
	e := echo.New()
	e.Logger = adapters.NewEchoLogAdapter(logrus.StandardLogger())

	e.GET("/", func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello, World!\n")
	})

	e.Logger.Fatal(e.Start(":1323"))
}

License

Copyright (c) 2021-present Daniel Gatis

Licensed under MIT License

Buy me a coffee

Liked some of my work? Buy me a coffee (or more likely a beer)

Buy Me A Coffee

# Functions

NewBadgerLogAdapter creates a new adapter.
NewCronLogAdapter creates a new adapter.
NewEchoLogAdapter creates a new adapter.
NewHCLogAdapter creates a new adapter.

# Structs

BadgerLogAdapter represents an badger.Logger adapter.
CronLogAdapter represents an cron.Logger adapter.
EchoLogAdapter represents an echo.Logger adapter.
HCLogAdapter represents an hclog.Logger adapter.