log

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package log implements a logger interface that is used for logging inside Alphabill Wallet SDK.

In order to enable logging a logger must be registered fist by invoking SetLogger() with an Interface implementation. Logging can be disabled by calling SetLogger(nil).

Package provides a basic logging implementation Logger, that generates lines of formatted output to an io.Writer.

Index

Constants

This section is empty.

Variables

View Source
var Levels = map[string]Priority{
	"NONE":    NONE,
	"ERROR":   ERROR,
	"WARNING": WARNING,
	"NOTICE":  NOTICE,
	"INFO":    INFO,
	"DEBUG":   DEBUG,
}

Functions

func Debug

func Debug(v ...interface{})

Debug for debug level logging. Events generated to aid in debugging, application flow and detailed service troubleshooting. Deprecated: Use pkg/logger instead.

func Error

func Error(v ...interface{})

Error for error level logging. Unrecoverable fatal errors only - gasp of death - code cannot continue and will terminate. Deprecated: Use pkg/logger instead. instead.

func Info

func Info(v ...interface{})

Info for info level logging. Events that have no effect on service, but can aid in performance, status and statistics monitoring. Deprecated: Use pkg/logger instead.

func InitLogger added in v0.1.3

func InitLogger(logger pkglogger.Logger)

func InitStdoutLogger deprecated

func InitStdoutLogger(priority Priority) error

Deprecated: Use pkg/logger instead.

func Notice

func Notice(v ...interface{})

Notice for info level logging. Changes in state that do not necessarily cause service degradation. Deprecated: Use pkg/logger instead.

func SetLogger

func SetLogger(l Logger)

SetLogger initialize a global logger. In order to disable logging set the parameter l to nil. Deprecated: Use pkg/logger instead.

func Warning

func Warning(v ...interface{})

Warning for warning level logging. Changes in state that affects the service degradation. Deprecated: Use pkg/logger instead.

Types

type Logger deprecated

type Logger interface {
	// Debug for debug priority logging. Events generated to aid in debugging,
	// application flow and detailed service troubleshooting.
	Debug(v ...interface{})

	// Info for info priority logging. Events that have no effect on service,
	// but can aid in performance, status and statistics monitoring.
	Info(v ...interface{})

	// Notice for info priority logging. Changes in state that do not necessarily
	// cause service degradation.
	Notice(v ...interface{})

	// Warning for warning priority logging. Changes in state that affects the service
	// degradation.
	Warning(v ...interface{})

	// Error for error priority logging. Unrecoverable fatal errors only - gasp of
	// death - code cannot continue and will terminate.
	Error(v ...interface{})
}

Deprecated: Use pkg/logger instead.

func GetLogger deprecated added in v0.1.3

func GetLogger() Logger

Deprecated: Use pkg/logger instead.

type Priority

type Priority uint

Priority is the log level

const (
	// NONE Logging is turned off.
	NONE Priority = iota

	// ERROR log level - unrecoverable fatal errors only - gasp of
	// death - code cannot continue and will terminate.
	ERROR

	// WARNING log level - changes in state that affects the service
	// degradation.
	WARNING

	// NOTICE log level - changes in state that do not necessarily
	// cause service degradation.
	NOTICE

	// INFO log level - events that have no effect on service, but
	// can aid in performance, status and statistics monitoring.
	INFO

	// DEBUG log level - events generated to aid in debugging,
	// application flow and detailed service troubleshooting.
	DEBUG
)

type WriterLogger deprecated

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

A WriterLogger represents an active logging object that generates lines of output to an io.Writer. It is a wrapper object for the standard library log.Logger.

Deprecated: Use pkg/logger instead.

func New

func New(priority Priority, output io.Writer) (*WriterLogger, error)

New creates a new WriterLogger. Priority set the internal log level. Higher level will have greater impact on the performance. The log entries are written to the output. In case output is not provided the log is written to stdout. Return a new WriterLogger object, or error. Deprecated: Use pkg/logger instead.

func (*WriterLogger) Debug

func (l *WriterLogger) Debug(v ...interface{})

Debug for debug level logging. Events generated to aid in debugging, application flow and detailed service troubleshooting.

func (*WriterLogger) Error

func (l *WriterLogger) Error(v ...interface{})

Error for error level logging. Unrecoverable fatal errors only - gasp of death - code cannot continue and will terminate.

func (*WriterLogger) Info

func (l *WriterLogger) Info(v ...interface{})

Info for info level logging. Events that have no effect on service, but can aid in performance, status and statistics monitoring.

func (*WriterLogger) Notice

func (l *WriterLogger) Notice(v ...interface{})

Notice for info level logging. Changes in state that do not necessarily cause service degradation.

func (*WriterLogger) SetCalldepth

func (l *WriterLogger) SetCalldepth(d int)

SetCalldepth is setter for stack call depth. Used to recover the PC and is provided for generality. By default, is set to 4.

func (*WriterLogger) Warning

func (l *WriterLogger) Warning(v ...interface{})

Warning for warning level logging. Changes in state that affects the service degradation.

Jump to

Keyboard shortcuts

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