示例#1
0
文件: internal.go 项目: tychoish/grip
func (s *InternalSender) SetThresholdLevel(p level.Priority) error {
	s.Lock()
	defer s.Unlock()

	if level.IsValidPriority(p) {
		s.level.thresholdLevel = p
		return nil
	}
	return fmt.Errorf("%s (%d) is not a valid priority value (0-6)", p, int(p))
}
示例#2
0
func (s *systemdJournal) SetDefaultLevel(p level.Priority) error {
	s.Lock()
	defer s.Unlock()

	if level.IsValidPriority(p) {
		s.level.defaultLevel = p
		return nil
	}

	return fmt.Errorf("%s (%d) is not a valid priority value (0-6)", p, (p))
}
示例#3
0
文件: native.go 项目: tychoish/grip
func (n *nativeLogger) SetThresholdLevel(p level.Priority) error {
	n.Lock()
	defer n.Unlock()

	if level.IsValidPriority(p) {
		n.level.thresholdLevel = p
		return nil
	}

	return fmt.Errorf("%s (%d) is not a valid priority value (0-6)", p, int(p))
}
示例#4
0
文件: file.go 项目: tychoish/grip
func (f *fileLogger) SetDefaultLevel(p level.Priority) error {
	f.Lock()
	defer f.Unlock()

	if level.IsValidPriority(p) {
		f.level.defaultLevel = p
		return nil
	}

	return fmt.Errorf("%s (%d) is not a valid priority value (0-6)", p, int(p))
}