github.com/mundipagg/tracer-splunk-writer@v1.0.6/level.go (about)

     1  package splunk
     2  
     3  import (
     4  	"github.com/mralves/tracer"
     5  )
     6  
     7  const (
     8  	Debug       = "Debug"
     9  	Information = "Information"
    10  	Warning     = "Warning"
    11  	Error       = "Error"
    12  	Fatal       = "Fatal"
    13  	Verbose     = "Verbose"
    14  )
    15  
    16  func Level(level uint8) string {
    17  	switch level {
    18  	case tracer.Debug:
    19  		return Debug
    20  	case tracer.Informational:
    21  		return Information
    22  	case tracer.Notice, tracer.Warning:
    23  		return Warning
    24  	case tracer.Critical, tracer.Error:
    25  		return Error
    26  	case tracer.Alert, tracer.Fatal:
    27  		return Fatal
    28  	default:
    29  		return Verbose
    30  	}
    31  }