common

package
v0.0.0-...-2379a7f Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldNameModule = "module"
	FieldNameID     = "id"
)

Field name constants for the field names used on the logger entry.

Variables

This section is empty.

Functions

func ModuleLogEntry

func ModuleLogEntry(log *logrus.Logger, moduleName string) *logrus.Entry

ModuleLogEntry creates a new logrus entry that includes the module name as a field.

func ModuleLogEntryWithID

func ModuleLogEntryWithID(log *logrus.Logger, moduleName string) *logrus.Entry

ModuleLogEntryWithID creates a new logrus entry that includes both the module name and a global id as keys. This is useful when multiple instances of the same module will be running as the id can then be used to keep track of each module instance.

func NextGlobalID

func NextGlobalID() string

NextGlobalID returns the next value of a global id counter, shared between any caller to this method. The returned id is returned as a base36 string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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