logger

package
v0.0.0-...-9e3aff1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RootPath string = ""
)

Copyright 2017 Nicolas JUHEL

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Functions

func GetFormatListString

func GetFormatListString() []string

func GetGID

func GetGID() uint64

func GetIOWriter

func GetIOWriter(level Level, msgPrefixPattern string, msgPrefixArgs ...interface{}) io.Writer

func GetLevelListString

func GetLevelListString() []string

func SetFormat

func SetFormat(fmt string)

func SetLevel

func SetLevel(level string)

Types

type Format

type Format uint8
const (
	TextFormat Format = iota
	JsonFormat
)

func (Format) String

func (f Format) String() string

type IOWriter

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

func (IOWriter) Write

func (iow IOWriter) Write(p []byte) (n int, err error)

type Level

type Level uint32

Level type

const (
	PanicLevel Level = iota
	FatalLevel
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
	NilLevel
)

func (Level) Log

func (level Level) Log(message string)

func (Level) LogData

func (level Level) LogData(message string, data interface{})

func (Level) LogError

func (level Level) LogError(err error) bool

func (Level) LogErrorCtx

func (level Level) LogErrorCtx(levelElse Level, context string, err error) bool

func (Level) LogErrorCtxf

func (level Level) LogErrorCtxf(levelElse Level, contextPattern string, err error, args ...interface{}) bool

func (Level) Logf

func (level Level) Logf(format string, args ...interface{})

func (Level) String

func (level Level) String() string

Convert the Level to a string. E.g. PanicLevel becomes "panic".

func (Level) Uint8

func (level Level) Uint8() uint8

func (Level) WithFields

func (level Level) WithFields(message string, fields map[string]interface{})

Jump to

Keyboard shortcuts

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