Files
vRp.CD2g_test/utils/log/survey/options.go

15 lines
365 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package survey
import "time"
// Option 选项
type Option func(logger *logger)
// WithFlushInterval 设置日志文件刷新间隔
// - 默认为 3s当日志文件刷新间隔 <= 0 时,将会在每次写入日志时刷新日志文件
func WithFlushInterval(interval time.Duration) Option {
return func(logger *logger) {
logger.interval = interval
}
}