startup_base

package
v2.3.56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildPackage       string
	BuildGitHash       string
	BuildVersion       string
	BuildUnixTimestamp string
)
View Source
var LogLevel slog.LevelVar

Functions

func Close

func Close(closer io.Closer, onErrorMessage string)

func Errorf

func Errorf(msg string, args ...interface{}) error

func FatalOnError

func FatalOnError(err error, reason string, args ...interface{})

func GetEnvironment added in v2.3.56

func GetEnvironment() string

func IsDevelopment added in v2.3.55

func IsDevelopment() bool

func IsProduction added in v2.3.55

func IsProduction() bool

func IsStaging added in v2.3.55

func IsStaging() bool

func IsTesting added in v2.3.55

func IsTesting() bool

func OpenWriter

func OpenWriter(name string) (*os.File, error)

func PanicOnError

func PanicOnError(err error, msg string, args ...interface{})

func Panicf

func Panicf(msg string, args ...interface{})

Types

type BaseOptions

type BaseOptions struct {
	Logfile       string `long:"log-file" description:"Write logs to a different file. Defaults to stdout."`
	ForceColor    bool   `long:"log-color" description:"Forces colored output even on non TTYs."`
	JSONFormatter bool   `long:"log-json" description:"Log using the logrus json formatter."`

	Verbose     bool   `long:"verbose" description:"Show verbose logging output."`
	Version     bool   `long:"version" description:"Prints the build information about this application if available."`
	Environment string `long:"environment" description:"The environment this application is running in."`
}

func (*BaseOptions) Initialize

func (opts *BaseOptions) Initialize()

type LazyHandler added in v2.3.0

type LazyHandler struct {
	Delegate func() slog.Handler
}

func (*LazyHandler) Enabled added in v2.3.0

func (v *LazyHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*LazyHandler) Handle added in v2.3.0

func (v *LazyHandler) Handle(ctx context.Context, record slog.Record) error

func (*LazyHandler) WithAttrs added in v2.3.0

func (v *LazyHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*LazyHandler) WithGroup added in v2.3.0

func (v *LazyHandler) WithGroup(name string) slog.Handler

type StartupError

type StartupError error

Directories

Path Synopsis
Package tint implements a zero-dependency slog.Handler that writes tinted (colorized) logs.
Package tint implements a zero-dependency slog.Handler that writes tinted (colorized) logs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL