Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEventLoggerContext ¶
NewEventLoggerContext returns a context with the Logger embedded as a value
func StandardLogger ¶
StandardLogger returns a log.Logger that writes to l, or a default logger to stdout if l is nil
Types ¶
type EventLoggerContextKey ¶
type EventLoggerContextKey string
type Logger ¶
type Logger struct { DL persistence.EventLoggerDataLayer ID uuid.UUID Sink io.Writer // ExcludeID determines whether to omit the ID from log strings ExcludeID bool }
Logger is an object that writes log lines to the database in an EventLog as well as to Sink
func GetLogger ¶
GetLogger returns the Logger if present or a default logger that logs to stdout if not present
func (*Logger) Init ¶
Init initializes the EventLog object in the database. This must be called exactly once prior to any log lines.
func (*Logger) SetEnvName ¶
SetEnvName sets the environment name for this logger. Init must be called first.
Click to show internal directories.
Click to hide internal directories.