Documentation ¶
Index ¶
- func Bootstrap()
- func InitializeLogging(thelmaConfig config.Config, thelmaRoot root.Root) error
- func NewFilteredWriter(inner zerolog.LevelWriter, filterBelow zerolog.Level) zerolog.LevelWriter
- func NewMaskingWriter(inner io.Writer, secrets []string) zerolog.LevelWriter
- func WithMask(secrets ...string) zerolog.Logger
- type FilteredWriter
- type MaskingWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bootstrap ¶ added in v0.0.24
func Bootstrap()
Bootstrap configure global zerolog logger with a basic console logger to catch any messages that are logged before full Thelma initialization
func InitializeLogging ¶
InitializeLogging updates the global Zerolog logger to match Thelma's configuration. It should be called once during Thelma initialization.
func NewFilteredWriter ¶
func NewFilteredWriter(inner zerolog.LevelWriter, filterBelow zerolog.Level) zerolog.LevelWriter
func NewMaskingWriter ¶ added in v0.0.27
func NewMaskingWriter(inner io.Writer, secrets []string) zerolog.LevelWriter
Types ¶
type FilteredWriter ¶
type FilteredWriter struct {
// contains filtered or unexported fields
}
FilteredWriter drops log messages below a specified threshold
func (*FilteredWriter) WriteLevel ¶
type MaskingWriter ¶ added in v0.0.27
type MaskingWriter struct {
// contains filtered or unexported fields
}
MaskingWriter replaces sensitive text in log messages
func (*MaskingWriter) Write ¶ added in v0.0.27
func (w *MaskingWriter) Write(p []byte) (n int, err error)
Note that Zerolog guarantees log messages won't be split up across multiple Write calls: "Each logging operation makes a single call to the Writer's Write method." (https://github.com/rs/zerolog/blob/e9344a8c507b5f25a4962ff022526be0ddab8e72/log.go#L210) So we don't need to worry about secrets potentially being split across multiple writes.