Documentation ¶
Index ¶
- func Bootstrap()
- func Initialize(thelmaConfig config.Config, thelmaRoot root.Root) error
- func MaskSecret(secret ...string)
- func NewFilteredWriter(inner zerolog.LevelWriter, filterBelow zerolog.Level) zerolog.LevelWriter
- func NewWrappingWriter(inner io.Writer, opts ...func(*wordwrap.Options)) io.Writer
- type FilteredWriter
- type MaskingWriter
- type WrappingWriter
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 Initialize ¶ added in v1.0.20
Initialize updates the global Zerolog logger to match Thelma's configuration. It should be called once during Thelma initialization.
func MaskSecret ¶ added in v0.0.34
func MaskSecret(secret ...string)
MaskSecret configures the global logger to mask the given secret(s)
func NewFilteredWriter ¶
func NewFilteredWriter(inner zerolog.LevelWriter, filterBelow zerolog.Level) 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 NewMaskingWriter ¶ added in v0.0.27
func NewMaskingWriter(inner io.Writer) *MaskingWriter
func (*MaskingWriter) MaskSecrets ¶ added in v0.0.34
func (w *MaskingWriter) MaskSecrets(secrets ...string)
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.
func (*MaskingWriter) WriteLevel ¶ added in v0.0.27
type WrappingWriter ¶ added in v1.0.44
type WrappingWriter struct {
// contains filtered or unexported fields
}
WrappingWriter wraps lines in log messages to a given width