ylog

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LOG_LEVEL_DEBUG = "DEBUG"
View Source
const LOG_LEVEL_ERROR = "ERROR"
View Source
const LOG_LEVEL_FATAL = "FATAL"
View Source
const LOG_LEVEL_INFO = "INFO"
View Source
const LOG_LEVEL_TRACE = "TRACE"
View Source
const LOG_LEVEL_WARN = "WARN"
View Source
const LOG_OUTPUT_STDERR = "STDERR"
View Source
const LOG_OUTPUT_STDOUT = "STDOUT"
View Source
const LOG_TYPE_JSON = "JSON"
View Source
const LOG_TYPE_LTSV = "LTSV"
View Source
const LOG_TYPE_PLAIN = "PLAIN"
View Source
const OUTPUT_JSON = 1
View Source
const OUTPUT_LTSV = 2
View Source
const OUTPUT_PLAIN = 0
View Source
const TIME_FORMAT = "2006/01/02 15:04:05"

Variables

This section is empty.

Functions

func Init

func Init()

Must call this from file in project root dir

func SetLogLevel

func SetLogLevel(level string) error

ログ出力しきい値を設定します。 level = [TRACE | DEBUG | INFO | WARN | ERROR | FATAL]

func SetLogOutput

func SetLogOutput(output string)

ログ出力先を設定します output = [STDERR | STDOUT]

func SetLogType

func SetLogType(logtype string)

ログ出力形式を設定します。 logtype = [PLAIN | JSON]

Types

type Logger

type Logger interface {
	T(args ...interface{})
	D(args ...interface{})
	I(args ...interface{})
	W(args ...interface{})
	E(args ...interface{})
	F(args ...interface{})
}

type Logging

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

type YLogger

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

func GetLogger

func GetLogger() *YLogger

func GetLoggerByName

func GetLoggerByName(name string) *YLogger

Loggerを取得します name = 名称。 main とか sub1 とか。 ログに出力される。

func (*YLogger) Add

func (l *YLogger) Add(key string, value interface{}) *YLogger

json時次のログ出力に追加する値。これでセットした値は一度ログ出力を行うと削除される

func (*YLogger) D

func (l *YLogger) D(args ...interface{})

func (*YLogger) E

func (l *YLogger) E(args ...interface{})

func (*YLogger) F

func (l *YLogger) F(args ...interface{})

func (*YLogger) I

func (l *YLogger) I(args ...interface{})

func (*YLogger) T

func (l *YLogger) T(args ...interface{})

func (*YLogger) W

func (l *YLogger) W(args ...interface{})

func (*YLogger) With

func (l *YLogger) With(key string, value interface{}) *YLogger

json時次のログ出力に追加する値。addとの違いはこちらは一度追加したら残り続ける

Jump to

Keyboard shortcuts

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