loglevelswitcher

package
v0.0.0-...-21d585c Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	SetLevel(logrus.Level) // inside this function you can log the change of level
}

Logger is an interface used by the log level switcher Service Activity to set the level of a logger.

type ServiceActivity

type ServiceActivity struct {
	// contains filtered or unexported fields
}

ServiceActivity implements the async.Runner & async.Closer interface for switching a logger level through command line.

func New

func New(l Logger, s os.Signal) *ServiceActivity

New creates a new service activity that listens for a specific os signal and attempts to toggle the level of the provided logger to debug mode.

func (*ServiceActivity) Close

func (s *ServiceActivity) Close(_ context.Context) error

Close closes the log level switcher service activity

func (*ServiceActivity) Run

func (sa *ServiceActivity) Run(ctx context.Context) error

Run runs the log level switcher service activity

Jump to

Keyboard shortcuts

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