log

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package log provides a universal logger for martian packages.

Index

Constants

View Source
const (
	// Silent is a level that logs nothing.
	Silent int = iota
	// Error is a level that logs error logs.
	Error
	// Info is a level that logs error, and info logs.
	Info
	// Debug is a level that logs error, info, and debug logs.
	Debug
)

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, args ...interface{})

Debugf logs a debug message.

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs an error message.

func Infof

func Infof(format string, args ...interface{})

Infof logs an info message.

func SetLevel

func SetLevel(l int)

SetLevel sets the global log level.

func SetLogger

func SetLogger(l Logger)

SetLogger changes the default logger. This must be called very first, before interacting with rest of the martian package. Changing it at runtime is not supported.

Types

type Logger

type Logger interface {
	Infof(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Jump to

Keyboard shortcuts

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