Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NewLogger = NewZapLogger
Functions ¶
func NewAlert ¶
func NewAlert(priority AlertPriority, servicePrefix string, alertType string) logAlert
NewAlert ceates a new instance of logAlert type which implements the Alert interface.
Types ¶
type Alert ¶
type Alert interface { Priority() AlertPriority fmt.Stringer }
Alert interface is implemented by all alerts.
type AlertPriority ¶
type AlertPriority int
AlertPriority is a type representing priority of an alert.
const ( AlertP0 AlertPriority = iota AlertP1 AlertP2 )
type Config ¶
type Config struct {
Environment string `json:"environment" toml:"environment" validate:"oneof=dev development prod production no-op"`
}
type Logger ¶
type Logger interface { // With returns a Logger containing fields provided // and is similar to logrus's FieldLogger With(args ...interface{}) Logger WithAlert(alert Alert) Logger io.Writer // contains filtered or unexported methods }
Logger is an interface that all logging systems will implement.
func NewZapLogger ¶
NewZapLogger returns a new instance of *zap.SugaredLogger which implements the Logger interface.
Click to show internal directories.
Click to hide internal directories.