golog

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 13 Imported by: 3

README

golog

4everland internal go service log format

Install

go get github.com/4everland/golog

Usage

 logger := golog.NewFormatStdLogger(
        os.Stdout, 
        golog.WithFilterLevel(log.LevelInfo), 
        golog.WithServerName("name"", "version"))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithFilterLevel

func WithFilterLevel(level kratoslog.Level) func(logger *stdLogger)

func WithServerName

func WithServerName(name string, version string) func(logger *stdLogger)

Types

type Logger

type Logger interface {
	Log(level kratoslog.Level, keyvals ...interface{}) error
}

Logger is a logger interface.

func NewFormatStdLogger

func NewFormatStdLogger(w io.Writer, opts ...Option) Logger

NewFormatStdLogger new a logger with writer.

type Option

type Option func(logger *stdLogger)

type ReportInterface

type ReportInterface interface {
	Report(msg string)
}

Jump to

Keyboard shortcuts

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