logginglib

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: CC0-1.0, CC0-1.0, CC0-1.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(v rt.Value, lg log.Interface) bool

SetLogger sets the logger on a lua value, if the value supports the log.SetLoggerer interface. Returns true on success, false otherwise.

func ValueToSetLoggerer

func ValueToSetLoggerer(v rt.Value) (log.SetLoggerer, bool)

ValueToSetLoggerer turns a lua value to a log.SetLoggerer, if possible.

Types

type Logger

type Logger struct {
	*logger.Logger
	// contains filtered or unexported fields
}

Logger wraps a logger.Logger.

func LoggerArg

func LoggerArg(c *rt.GoCont, n int) (*Logger, error)

LoggerArg turns a continuation argument into a *Logger.

func ValueToLogger

func ValueToLogger(v rt.Value) (*Logger, bool)

ValueToLogger turns a lua value to a *Logger, if possible.

func (*Logger) GetTimeout

func (l *Logger) GetTimeout() time.Duration

GetTimeout returns the timeout.

func (*Logger) PrefixWith

func (l *Logger) PrefixWith(format string, v ...interface{}) *Logger

PrefixWith returns a new logger, wrapping the given logger l, that automatically prepends the given data to all log messages.

func (*Logger) SetTimeout

func (l *Logger) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout. A negative timeout is interpreted to mean no timeout.

func (*Logger) With

func (l *Logger) With(format string, v ...interface{}) *Logger

With returns a new logger, wrapping the given logger l, that automatically appends the given data to all log messages.

Jump to

Keyboard shortcuts

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