log

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package log defines SCALIBR's logger interface. By default it uses the Go logger but it can be replaced with user-defined loggers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...any)

Debug is the static debug logging function.

func Debugf

func Debugf(format string, args ...any)

Debugf is the static formatted debug logging function.

func Error

func Error(args ...any)

Error is the static error logging function.

func Errorf

func Errorf(format string, args ...any)

Errorf is the static formatted error logging function.

func Info

func Info(args ...any)

Info is the static info logging function.

func Infof

func Infof(format string, args ...any)

Infof is the static formatted info logging function.

func SetLogger

func SetLogger(l Logger)

SetLogger overwrites the default SCALIBR logger with a user specified one.

func Warn

func Warn(args ...any)

Warn is the static warning logging function.

func Warnf

func Warnf(format string, args ...any)

Warnf is the static formatted warning logging function.

Types

type DefaultLogger

type DefaultLogger struct {
	Verbose bool // Whether debug logs should be shown.
}

DefaultLogger is the Logger implementation used by default. It just logs to stderr using the default Go logger.

func (*DefaultLogger) Debug

func (l *DefaultLogger) Debug(args ...any)

Debug is the debug logging function.

func (*DefaultLogger) Debugf

func (l *DefaultLogger) Debugf(format string, args ...any)

Debugf is the formatted debug logging function.

func (DefaultLogger) Error

func (DefaultLogger) Error(args ...any)

Error is the error logging function.

func (DefaultLogger) Errorf

func (DefaultLogger) Errorf(format string, args ...any)

Errorf is the formatted error logging function.

func (DefaultLogger) Info

func (DefaultLogger) Info(args ...any)

Info is the info logging function.

func (DefaultLogger) Infof

func (DefaultLogger) Infof(format string, args ...any)

Infof is the formatted info logging function.

func (DefaultLogger) Warn

func (DefaultLogger) Warn(args ...any)

Warn is the warning logging function.

func (DefaultLogger) Warnf

func (DefaultLogger) Warnf(format string, args ...any)

Warnf is the formatted warning logging function.

type Logger

type Logger interface {
	// Logs in different log levels, either formatted or unformatted.
	Errorf(format string, args ...any)
	Error(args ...any)
	Warnf(format string, args ...any)
	Warn(args ...any)
	Infof(format string, args ...any)
	Info(args ...any)
	Debugf(format string, args ...any)
	Debug(args ...any)
}

Logger is SCALIBR's logging interface.

Jump to

Keyboard shortcuts

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