log

package
v0.0.0-...-acd5dfc Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(a ...interface{})

func Error

func Error(a ...interface{})

func Info

func Info(a ...interface{})

func IsColorsSupported

func IsColorsSupported() bool

func IsStdErrTerminal

func IsStdErrTerminal() bool

Check if StdErr is a terminal

func IsStdOutTerminal

func IsStdOutTerminal() bool

Check if Stdout is a terminal

func NewLogger

func NewLogger(logLevel LevelType, logToWriter io.Writer) *jfrogLogger

Same as NewLoggerWithFlags, with log flags turned off.

func NewLoggerWithFlags

func NewLoggerWithFlags(logLevel LevelType, writer io.Writer, logFlags int) *jfrogLogger

Creates a new logger with a given LogLevel. All logs are written to Stderr by default (output to Stdout). If logToWriter != nil, logging is done to the provided writer instead. Log flags to modify the log prefix as described in https://pkg.go.dev/log#pkg-constants.

func Output

func Output(a ...interface{})

func SetIsTerminalFlagsWithCallback

func SetIsTerminalFlagsWithCallback(isTerminal bool) func()

SetIsTerminalFlagsWithCallback changes IsTerminal flags to the given value and return function that changes the flags back to the original values.

func SetLogger

func SetLogger(newLogger Log)

func Warn

func Warn(a ...interface{})

Types

type LevelType

type LevelType int
const (
	ERROR LevelType = iota
	WARN
	INFO
	DEBUG
)

type Log

type Log interface {
	Debug(a ...interface{})
	Info(a ...interface{})
	Warn(a ...interface{})
	Error(a ...interface{})
	Output(a ...interface{})
	GetLogLevel() LevelType
}
var Logger Log

func GetLogger

func GetLogger() Log

type LogFormat

type LogFormat string
var Format LogFormat

Used for coloring sections of the log message. For example log.Format.Path("...")

func (*LogFormat) Path

func (f *LogFormat) Path(message string) string

Predefined color formatting functions

func (*LogFormat) URL

func (f *LogFormat) URL(message string) string

Jump to

Keyboard shortcuts

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