log

package
v0.0.0-...-9bf116a Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package log is a generic logging system that does multiplexing of logs according to the caller interface of the log functions. InitLogging() should be called to set up multiplexing for an interface and Log(intf interface{}) should be used for all subsequent loggings. A logging hook is used that gets triggered on every log function calls, and this is where multiplexing is done. The hook keeps a map from raw pointers of the interfaces passed in by InitLogging() to its output io.Writer. A call to Log(intf interface{}) sets the caller key, which is then retrieved in the hook to determine which io.Writer to use for the log entry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogging

func InitLogging(filename string, intf interface{}) error

InitLogging sets up logging for an input interface.

func Log

func Log(intf interface{}) *logrus.Entry

Log is a wrapper for logging information related to an interface.

func SetLogDir

func SetLogDir(logDir string)

SetLogDir sets the output of the log files to a directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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