git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/log/slogx/fatal.go (about)

     1  package slogx
     2  
     3  import (
     4  	"log/slog"
     5  	"os"
     6  )
     7  
     8  // TODO: use actual fatal level
     9  // https://opentelemetry.io/docs/reference/specification/logs/data-model/#example-mappings
    10  func Fatal(logger *slog.Logger, message string, args ...any) {
    11  	logger.Error(message, args...)
    12  	os.Exit(1)
    13  }