Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnConfigLevel = errors.New("ErrUnConfigLevel")
)
Functions ¶
func NewHook ¶
func NewHook(cfg HookConfig) *hook
Types ¶
type HookConfig ¶
type HookConfig struct { FlushTime int64 // ms FlushCount int64 Levels map[string]levelConfig // contains filtered or unexported fields }
HookConfig config info for hook, can load as toml
func (*HookConfig) AddLevel ¶
func (h *HookConfig) AddLevel( level Level, path string, time4seg int64, size4seg int64)
AddLevel add config info for a log level
func (*HookConfig) LoadFromToml ¶
func (h *HookConfig) LoadFromToml(datas []byte) error
LoadFromToml load config info by "github.com/BurntSushi/toml"
Click to show internal directories.
Click to hide internal directories.