eclog

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	// Debug writes debug messages
	Debug(format string, v ...interface{})

	// Info writes info messages
	Info(format string, v ...interface{})

	// Error writes warning messages
	Warn(format string, v ...interface{})

	// Error writes error messages
	Error(format string, v ...interface{})
}

Logger defines the the basic implementation that meets the SDK's logging needs

func NewFileLogger

func NewFileLogger(filePath string) Logger

Creates a logger that writes to a single log file

func NewNullLogger

func NewNullLogger() Logger

Creates a logger that does nothing with messages

func NewStandardLogger

func NewStandardLogger() Logger

Creates a logger that writes to the standard output and error streams

type NullLogger

type NullLogger struct{}

A logger that will do nothing with messages

func (NullLogger) Debug

func (l NullLogger) Debug(format string, v ...interface{})

Debug does nothing

func (NullLogger) Error

func (l NullLogger) Error(format string, v ...interface{})

Error does nothing

func (NullLogger) Info

func (l NullLogger) Info(format string, v ...interface{})

Info does nothing

func (NullLogger) Warn

func (l NullLogger) Warn(format string, v ...interface{})

Warn does nothing

type SimpleLogger

type SimpleLogger struct {
	InfoLogger    *log.Logger
	DebugLogger   *log.Logger
	ErrorLogger   *log.Logger
	WarningLogger *log.Logger
}

A basic implementation of Logger using log.Logger internally

func (SimpleLogger) Debug

func (l SimpleLogger) Debug(format string, v ...interface{})

Debug writes Debug messages to stdout

func (SimpleLogger) Error

func (l SimpleLogger) Error(format string, v ...interface{})

Error writes to error messages to stderr

func (SimpleLogger) Info

func (l SimpleLogger) Info(format string, v ...interface{})

Info writes Info messages to stdout

func (SimpleLogger) Warn

func (l SimpleLogger) Warn(format string, v ...interface{})

Warn writes to error messages to stderr

Jump to

Keyboard shortcuts

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