logging

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvLog     = "AFX_LOG"
	EnvLogFile = "AFX_LOG_PATH"
)

These are the environmental variables that determine if we log, and if we log whether or not the log should go to a file.

Variables

View Source
var ValidLevels = []logutils.LogLevel{"TRACE", "DEBUG", "INFO", "WARN", "ERROR"}

ValidLevels is a list of valid log levels

Functions

func IsDebugOrHigher

func IsDebugOrHigher() bool

IsDebugOrHigher returns whether or not the current log level is debug or trace

func IsSet

func IsSet() bool

IsSet returns true if AFX_LOG is set

func IsTrace

func IsTrace() bool

func LogLevel

func LogLevel() string

LogLevel returns the current log level string based the environment vars

func LogOutput

func LogOutput() (logOutput io.Writer, err error)

LogOutput determines where we should send logs (if anywhere) and the log level.

func NewTransport

func NewTransport(name string, t http.RoundTripper) *transport

func SetOutput

func SetOutput()

SetOutput checks for a log destination with LogOutput, and calls log.SetOutput with the result. If LogOutput returns nil, SetOutput uses ioutil.Discard. Any error from LogOutout is fatal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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