logger

package module
v0.0.0-...-5002411 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 7 Imported by: 0

README

judas-logger

logger gin+zap customize

Usage

Start using it

Download and install it:

$ go get github.com/judascrow/logger

Import it in your code:

import "github.com/judascrow/logger"

Example

See the example.

package main

import (
	"net/http"

	"github.com/gin-gonic/gin"
	"github.com/judascrow/logger"
)

func main() {
	r := gin.New()

	r.Use(logger.LoggerZap())

	// Example ping request.
	r.GET("/test", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{
			"success": true,
			"message": "API is Online",
		})
	})

	// Listen and Server in 0.0.0.0:8080
	r.Run(":8080")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseLogFile

func CloseLogFile()

func LoggerZap

func LoggerZap() gin.HandlerFunc

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL