Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.
/ logs-go-gin Public archive

Logging package for gin gonic based on logs-go wrapper

License

Notifications You must be signed in to change notification settings

microparts/logs-go-gin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repo is DEPRECATED! Use https://github.com/spacetab-io/logs-gin-go instead.

logs-go-gin

Logger fo gin gonic

Usage

Pass logrus instance to constructor.

package main

import (
    "time"

    ginLogger "github.com/microparts/logs-go-gin"

    "github.com/gin-gonic/gin"
    "github.com/sirupsen/logrus"
)

func main() {
    r := gin.New()
    r.Use(ginLogger.NewLogger(logrus.New()), gin.Recovery())
  
    // pingpong
    r.GET("/ping", func(c *gin.Context) {
        c.Data(200, "text/plain", []byte("pong"))
    })
    _ = r.Run("127.0.0.1:8080")
}

Licence

The software is provided under MIT Licence.

About

Logging package for gin gonic based on logs-go wrapper

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages