fiplog

package module
v0.0.0-...-25416d1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: MIT Imports: 10 Imported by: 1

README

fiplog

fiplog simple golang log lib with basic configurable log level, output format and location.

A typical config file could be:

level: Debug
file: fip.log
pattern: %date [%level] <%file> %msg

Usage The usage is simple:

logger := fiplog.GetLogger()
logger.Debug("debug")
logger.Info("info")
logger.Error("error:",err)

For detailed usage, please refer to the project page

Documentation

Overview

Pacakge fiplog provides log wrapper

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func InitWithFml

func InitWithFml(fml *fml.FML)

Types

type Config

type Config struct {
	Level Level
	//levelTo Level
	Filename string
	BufSize  int
	//size todo: rolling
	Pattern string //todo: pattern
}

type FIPLogger

type FIPLogger struct {
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger() *FIPLogger

func InitWithConfig

func InitWithConfig(config *Config) *FIPLogger

func (*FIPLogger) Close

func (l *FIPLogger) Close()

func (*FIPLogger) Debug

func (l *FIPLogger) Debug(v ...interface{})

func (*FIPLogger) Debugf

func (l *FIPLogger) Debugf(format string, v ...interface{})

func (*FIPLogger) Error

func (l *FIPLogger) Error(v ...interface{})

func (*FIPLogger) Errorf

func (l *FIPLogger) Errorf(format string, v ...interface{})

func (*FIPLogger) Flush

func (l *FIPLogger) Flush()

func (*FIPLogger) Info

func (l *FIPLogger) Info(v ...interface{})

func (*FIPLogger) Infof

func (l *FIPLogger) Infof(format string, v ...interface{})

func (*FIPLogger) Warning

func (l *FIPLogger) Warning(v ...interface{})

func (*FIPLogger) Warningf

func (l *FIPLogger) Warningf(format string, v ...interface{})

type Level

type Level int
const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarning
	LevelError
)

Jump to

Keyboard shortcuts

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