2025-06-04 18:28:27 -04:00
|
|
|
package bolt
|
|
|
|
|
|
|
|
type Option func(b *bolt)
|
|
|
|
|
2025-06-25 22:51:32 +00:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2025-06-04 18:28:27 -04:00
|
|
|
// 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
|
|
|
|
}
|
|
|
|
}
|
2025-06-25 22:51:32 +00:00
|
|
|
|
|
|
|
// sets the log level to determine how much bolt logs
|
|
|
|
func WithLogLevel(lvl LogLevel) Option {
|
|
|
|
return func(b *bolt) {
|
|
|
|
b.logLvl = lvl
|
|
|
|
}
|
|
|
|
}
|