Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinFormatter ¶
func GinFormatter() gin.LogFormatter
GinFormatter returns a gin.LogFormatter that includes additional context via logrus
func InitWithGCPDefaults ¶
func InitWithGCPDefaults()
InitWithGCPDefaults initializes a logger suitable for most Google Cloud Logging purposes
func NewContextWithFields ¶
NewContextWithFields returns a new context with a log entry derived from the default logger.
func SetLoggerOptions ¶
Types ¶
type GCPFormatter ¶
type GCPFormatter struct {
logrus.JSONFormatter
}
GCPFormatter is a logrus.JSONFormatter with additional handling to map log severity and timestamps to the specific named JSON fields ("severity" and "time") that Google Cloud Logging expects
func NewGCPFormatter ¶
func NewGCPFormatter() *GCPFormatter
type LoggedError ¶
type LoggedError struct { Message string // The original message passed to the logger Err error // The error added to the logger Caller *runtime.Frame // Available if logger is configured to report on the caller }
LoggedError wraps the original error and logging message.
func (LoggedError) Error ¶
func (e LoggedError) Error() string
Click to show internal directories.
Click to hide internal directories.