usvc

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 12 Imported by: 20

README

go-usvc

Checks GitHub Issues

Go Reference

Orignally a logging library with my opinions, rapidly becoming the microservice framework I didn't wanna write, with my opinions. Please see gokit or gomicro instead.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Global is a globally-scoped logger than can be used if you have no other choice
	Global logr.Logger
)

Functions

func ChannelWrapper

func ChannelWrapper(fn func() error) <-chan error

ChannelWrapper runs an error-returning func on a background goroutine. If the func returns an error, that is sent down the channel that's returned.

func GetLogger

func GetLogger(devMode bool, options ...int) logr.Logger

GetLogger returns a zap-based zapr Logger, typed as a logr.Logger

func InstallSignalHandlers

func InstallSignalHandlers(log logr.Logger) <-chan struct{}

InstallSignalHandlers registers handlers for common OS signals, and closes the returned channel if they're received.

func PrintUpdateLn added in v0.0.2

func PrintUpdateLn(s string)

PrintUpdateLn prints s to stdout. If stdout is connected to a terminal, it leaves the cursor at the end of the line and overwrites that line with any subsequent messages If stdout is not connected to a terminal, message are printed with newlines, just like fmt.Println() s should not contain any newline or other escape characters Calls to PrintUpdateLn should not be mixed with anything else that interacts with stdout

func SetLevel added in v0.0.3

func SetLevel(l int)

SetLevel sets the level of the entire tree of loggers returned from GetLogger

Types

This section is empty.

Jump to

Keyboard shortcuts

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