commit
1e1fc188b4
@ -1,23 +1,10 @@
|
|||||||
package log
|
package log
|
||||||
|
|
||||||
type Config struct {
|
var logMap = map[int]int{
|
||||||
JSON bool `yaml:"json"`
|
6: -1,
|
||||||
Level string `yaml:"level"`
|
5: 0,
|
||||||
// true to enable log sampling, where the same log message and level will be throttled.
|
4: 1,
|
||||||
// we have two layers of sampling
|
3: 2,
|
||||||
// 1. global sampling - within a second, it will log the first SampleInitial, then every SampleInterval messages.
|
2: 3,
|
||||||
// 2. per participant/track sampling - to be used with Logger.WithItemSampler(). This would be used to throttle
|
1: 4,
|
||||||
// the logs for a particular participant/track.
|
|
||||||
Sample bool `yaml:"sample,omitempty"`
|
|
||||||
|
|
||||||
// global sampling per server
|
|
||||||
// when sampling, the first N logs will be logged
|
|
||||||
SampleInitial int `yaml:"sample_initial,omitempty"`
|
|
||||||
// when sampling, every Mth log will be logged
|
|
||||||
SampleInterval int `yaml:"sample_interval,omitempty"`
|
|
||||||
|
|
||||||
// participant/track level sampling
|
|
||||||
ItemSampleSeconds int `yaml:"item_sample_seconds,omitempty"`
|
|
||||||
ItemSampleInitial int `yaml:"item_sample_initial,omitempty"`
|
|
||||||
ItemSampleInterval int `yaml:"item_sample_interval,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue