Example #1
0
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))
}
Example #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))
}
Example #3
0
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))
}
Example #4
0
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))
}