bolt/option.go
jake dd20b73b76 adding log level option (#1)
Reviewed-on: #1
Co-authored-by: jake <jake.young.dev@gmail.com>
Co-committed-by: jake <jake.young.dev@gmail.com>
2025-06-25 22:51:32 +00:00

26 lines
579 B
Go

package bolt
type Option func(b *bolt)
type LogLevel int
const (
LogLevelAll LogLevel = iota //logs all messages, and errors
LogLevelCmd LogLevel = iota //log only commands and responses, and errors
LogLevelErr LogLevel = iota //logs only errors
)
// sets the substring that must be present at the beginning of the message to indicate a command
func WithIndicator(i string) Option {
return func(b *bolt) {
b.indicator = i
}
}
// sets the log level to determine how much bolt logs
func WithLogLevel(lvl LogLevel) Option {
return func(b *bolt) {
b.logLvl = lvl
}
}