clog

package
v0.0.0-...-776a48c Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToString

func ConvertToString(fields []Field) string

Types

type BitColor

type BitColor = uint8
const (
	ForegroundBlue      BitColor = 0x1
	ForegroundGreen     BitColor = 0x2
	ForegroundRed       BitColor = 0x4
	ForegroundIntensity BitColor = 0x8
	ForegroundMask      BitColor = (ForegroundRed | ForegroundBlue | ForegroundGreen | ForegroundIntensity)
	BackgroundBlue      BitColor = 0x10
	BackgroundGreen     BitColor = 0x20
	BackgroundRed       BitColor = 0x40
	BackgroundIntensity BitColor = 0x80
	BackgroundMask      BitColor = (BackgroundRed | BackgroundBlue | BackgroundGreen | BackgroundIntensity)
)

type ConsoleLogger

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

func NewConsoleLogger

func NewConsoleLogger() *ConsoleLogger

func NewConsoleLoggerWithWriter

func NewConsoleLoggerWithWriter(writer io.Writer) *ConsoleLogger

func (*ConsoleLogger) Log

func (c *ConsoleLogger) Log(level clogint.LogLevel, timestring string, name string, fields []Field)

type Field

type Field = clogint.Field

func Blob

func Blob(key string, payload []uint8) Field

func Bool

func Bool(key string, val bool) Field

func Error

func Error(key string, err error) Field

func Int

func Int(key string, val int) Field

func Int16

func Int16(key string, val int16) Field

func Int32

func Int32(key string, val int32) Field

func Int64

func Int64(key string, val int64) Field

func Int8

func Int8(key string, val int8) Field

func Interface

func Interface(key string, val interface{}) Field

func String

func String(key string, val string) Field

func StringSlice

func StringSlice(key string, val []string) Field

func Stringer

func Stringer(key string, val fmt.Stringer) Field

func StringerSlice

func StringerSlice(key string, val []fmt.Stringer) Field

func Table

func Table(key string, columns []string, rows [][]string) Field

func TableStringer

func TableStringer(key string, columns []string, rows [][]fmt.Stringer) Field

func Uint

func Uint(key string, val uint) Field

func Uint16

func Uint16(key string, val uint16) Field

func Uint32

func Uint32(key string, val uint32) Field

func Uint64

func Uint64(key string, val uint64) Field

func Uint8

func Uint8(key string, val uint8) Field

type FileLogger

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

func NewFileLogger

func NewFileLogger(directory string, application string) (*FileLogger, error)

func (*FileLogger) Log

func (c *FileLogger) Log(level clogint.LogLevel, timestring string, name string, fields []Field)

type Log

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

func DefaultFileLog

func DefaultFileLog(organization string, applicationName string) (*Log, error)

func DefaultLog

func DefaultLog() *Log

func NewFileLog

func NewFileLog(directory string, applicationName string) (*Log, error)

func NewMultiLog

func NewMultiLog(loggers ...Logger) (*Log, error)

func (*Log) CheckDebug

func (l *Log) CheckDebug() bool

func (*Log) CheckInfo

func (l *Log) CheckInfo() bool

func (*Log) CheckTrace

func (l *Log) CheckTrace() bool

func (*Log) Debug

func (l *Log) Debug(name string, fields ...Field)

func (*Log) Err

func (l *Log) Err(err error)

func (*Log) Error

func (l *Log) Error(name string, fields ...Field)

func (*Log) Info

func (l *Log) Info(name string, fields ...Field)

func (*Log) InfoColor

func (l *Log) InfoColor(color BitColor, name string, fields ...Field)

func (*Log) LogLevel

func (l *Log) LogLevel() clogint.LogLevel

func (*Log) Panic

func (l *Log) Panic(name string, fields ...Field)

func (*Log) SetLogLevel

func (l *Log) SetLogLevel(level clogint.LogLevel)

func (*Log) SetLogLevelUsingString

func (l *Log) SetLogLevelUsingString(logLevelString string, defaultLevel clogint.LogLevel)

func (*Log) SetLogLevelUsingVerbosity

func (l *Log) SetLogLevelUsingVerbosity(verbosityCount int)

func (*Log) Trace

func (l *Log) Trace(name string, fields ...Field)

func (*Log) Warn

func (l *Log) Warn(name string, fields ...Field)

func (*Log) With

func (l *Log) With(name string, fields ...Field) *Log

type Logger

type Logger interface {
	Log(level clogint.LogLevel, timeString string, name string, fields []Field)
}

type MultiLogger

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

func NewMultiLogger

func NewMultiLogger(loggers ...Logger) (*MultiLogger, error)

func (*MultiLogger) Log

func (c *MultiLogger) Log(level clogint.LogLevel, timestring string, name string, fields []Field)

type OperatingSystem

type OperatingSystem int
const (
	Linux OperatingSystem = iota
	Windows
	MacOS
)

func DetectOperatingSystem

func DetectOperatingSystem() OperatingSystem

Jump to

Keyboard shortcuts

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