コード例 #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
ファイル: systemd.go プロジェクト: tychoish/gimlet
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))
}