logger

package
v0.0.0-...-7d0d6c4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogLevelDebug = "DEBUG"
	LogLevelPrint = "PRINT"
	LogLevelInfo  = "INFO"
	LogLevelWarn  = "WARN"
	LogLevelError = "Error"
)

Variables

View Source
var (
	EnableLog      bool = false
	EnableConsole  bool = true
	DefaultLogPath string
)

Functions

func InitJiaLog

func InitJiaLog()

func NewWriter

func NewWriter(jiaLog *JiaLog) *writer

func SetEnableConsole

func SetEnableConsole(isConsole bool)

func SetEnableLog

func SetEnableLog(isLog bool)

func SetLogPath

func SetLogPath(path string)

Types

type JiaLog

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

func NewJiaLog

func NewJiaLog() *JiaLog

func (*JiaLog) Debug

func (l *JiaLog) Debug(log, target string)

func (*JiaLog) Error

func (l *JiaLog) Error(log, target string)

func (*JiaLog) Info

func (l *JiaLog) Info(log, target string)

func (*JiaLog) Print

func (l *JiaLog) Print(log, target string)

func (*JiaLog) SetEnableConsole

func (l *JiaLog) SetEnableConsole(isConsole bool)

func (*JiaLog) SetEnableLog

func (l *JiaLog) SetEnableLog(isLog bool)

func (*JiaLog) SetLogPath

func (l *JiaLog) SetLogPath(path string)

func (*JiaLog) Warn

func (l *JiaLog) Warn(log, target string)

type JiaLogger

type JiaLogger interface {
	SetEnableLog(isLog bool)
	SetEnableConsole(isConsole bool)
	SetLogPath(path string)
	Debug(log string, target string)
	Print(log string, target string)
	Info(log string, target string)
	Warn(log string, target string)
	Error(log string, target string)
}

func Logger

func Logger() JiaLogger

Jump to

Keyboard shortcuts

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