logger

package
v0.0.0-...-b9898a9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EnableTerminalLog  = false
	DisableTerminalLog = true

	LogLevelFlag          = "loglevel"
	LogFileFlag           = "logfile"
	LogDirectoryFlag      = "log-directory"
	LogTransportLevelFlag = "transport-loglevel"

	LogSSHDirectoryFlag = "log-directory"
	LogSSHLevelFlag     = "log-level"
)

Variables

View Source
var (
	ManagementLogger *management.Logger
)

Functions

func Create

func Create(loggerConfig *Config) *zerolog.Logger

func CreateLoggerFromContext

func CreateLoggerFromContext(c *cli.Context, disableTerminal bool) *zerolog.Logger

func CreateSSHLoggerFromContext

func CreateSSHLoggerFromContext(c *cli.Context, disableTerminal bool) *zerolog.Logger

func CreateTransportLoggerFromContext

func CreateTransportLoggerFromContext(c *cli.Context, disableTerminal bool) *zerolog.Logger

Types

type Config

type Config struct {
	ConsoleConfig *ConsoleConfig // If nil, the logger will not log into the console
	FileConfig    *FileConfig    // If nil, the logger will not use an individual log file
	RollingConfig *RollingConfig // If nil, the logger will not use a rolling log

	MinLevel string // debug | info | error | fatal
}

Logging configuration

func CreateConfig

func CreateConfig(
	minLevel string,
	disableTerminal bool,
	rollingLogPath, nonRollingLogFilePath string,
) *Config

type ConsoleConfig

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

type FileConfig

type FileConfig struct {
	Dirname  string
	Filename string
}

func (*FileConfig) Fullpath

func (fc *FileConfig) Fullpath() string

type RollingConfig

type RollingConfig struct {
	Dirname  string
	Filename string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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