Documentation
¶
Index ¶
- Variables
- func FormatAppInfoHeader(name, version, build string) string
- func GetLogger(ctx context.Context) *logrus.Entry
- func GetModulePath(ctx context.Context) string
- func GetTaskId(ctx context.Context) uint64
- func NewLog(cfg config.Log) *logrus.Entry
- func NewRand(clock Clock) *rand.Rand
- func WithField(ctx context.Context, key string, value interface{}) context.Context
- func WithFields(ctx context.Context, fields logrus.Fields) context.Context
- func WithLogger(ctx context.Context, log *logrus.Entry) context.Context
- func WithModule(ctx context.Context, module string) context.Context
- func WithTaskId(ctx context.Context) context.Context
- type Clock
- type NullFormatter
- type PrinterDevNull
- type PrinterLog
Constants ¶
This section is empty.
Variables ¶
View Source
var DiscardEntry = logrus.NewEntry(DiscardLog)
View Source
var DiscardLog = &logrus.Logger{ Out: io.Discard, Hooks: make(logrus.LevelHooks), Formatter: new(NullFormatter), Level: logrus.PanicLevel, ExitFunc: os.Exit, ReportCaller: false, }
Functions ¶
func FormatAppInfoHeader ¶
func GetModulePath ¶ added in v1.0.0
func NewRand ¶ added in v1.0.0
NewRand returns a new Rand that uses a locked rand.Source.
The Go rand.Source interface is not safe for concurrent use:
- Docs: https://golang.org/pkg/math/rand/#Source - Discuss: https://github.com/golang/go/issues/3611 - Solution: https://github.com/mesosphere/mesos-dns/pull/317
func WithFields ¶ added in v1.0.0
func WithLogger ¶ added in v1.0.0
func WithModule ¶ added in v1.0.0
Types ¶
type Clock ¶ added in v1.0.0
var ImmediatelyClock Clock = immediatelyClock{}
var NeverClock Clock = neverClock{}
var RealClock Clock = realClock{}
type NullFormatter ¶ added in v1.0.0
type NullFormatter struct{}
type PrinterDevNull ¶
type PrinterDevNull struct{}
type PrinterLog ¶
type PrinterLog struct {
// contains filtered or unexported fields
}
func NewPrinterLog ¶
func NewPrinterLog(log *logrus.Entry, gameId int) *PrinterLog
func (*PrinterLog) Print ¶
func (p *PrinterLog) Print(level, what, message string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.