log

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 9 Imported by: 8

Documentation

Overview

This is a wrapper for the zap framework no SugerLogger, Only Logger @author: 胖胖的ALEX example:

Log().Debug("debug log test")
Log().Info("info log test")
Log().Warn("warn log test")
Log().Error("error log test")
Log().Panic("panic log test")
Log().Fatal("fatal log test")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

func Error

func Error(msg string, fields ...zap.Field)

func Fatal

func Fatal(msg string, fields ...zap.Field)

func Info

func Info(msg string, fields ...zap.Field)

func Log

func Log() *zap.Logger

singleton pattern

func Panic

func Panic(msg string, fields ...zap.Field)

func Warn

func Warn(msg string, fields ...zap.Field)

Types

type Color added in v1.0.9

type Color struct {
	Info     func(a ...any) string
	Low      func(a ...any) string
	Midium   func(a ...any) string
	High     func(a ...any) string
	Critical func(a ...any) string
	Vulner   func(a ...any) string
	Time     func(a ...any) string
	Title    func(a ...any) string
	Banner   func(a ...any) string
	Bold     func(a ...any) string
}
var LogColor *Color

func NewColor added in v1.0.9

func NewColor() *Color

func (*Color) GetColor added in v1.0.9

func (c *Color) GetColor(level string, log string) string

Jump to

Keyboard shortcuts

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