github.com/orteth01/up@v0.2.0/internal/logs/logs.go (about) 1 // Package logs provides logging utilities. 2 package logs 3 4 import ( 5 "os" 6 7 "github.com/apex/log" 8 ) 9 10 // Plugin returns a log context for the given plugin name. 11 func Plugin(name string) log.Interface { 12 return log.WithFields(log.Fields{ 13 "app": os.Getenv("AWS_LAMBDA_FUNCTION_NAME"), 14 "region": os.Getenv("AWS_REGION"), 15 "version": os.Getenv("AWS_LAMBDA_FUNCTION_VERSION"), 16 "plugin": name, 17 }) 18 }