mirror of
https://github.com/mudler/luet.git
synced 2025-06-25 23:12:13 +00:00
Instead of using gox on one side and an action to release, we can merge them together with goreleaser which will build for extra targets (arm, mips if needed in the future) and it also takes care of creating checksums, a source archive, and a changelog and creating a release with all the artifacts. All binaries should respect the old naming convention, so any scripts out there should still work. Signed-off-by: Itxaka <igarcia@suse.com>
20 lines
442 B
Go
20 lines
442 B
Go
package log
|
|
|
|
import "context"
|
|
|
|
// logKey is a private context key.
|
|
type logKey struct{}
|
|
|
|
// NewContext returns a new context with logger.
|
|
func NewContext(ctx context.Context, v Interface) context.Context {
|
|
return context.WithValue(ctx, logKey{}, v)
|
|
}
|
|
|
|
// FromContext returns the logger from context, or log.Log.
|
|
func FromContext(ctx context.Context) Interface {
|
|
if v, ok := ctx.Value(logKey{}).(Interface); ok {
|
|
return v
|
|
}
|
|
return Log
|
|
}
|