log

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package log provides a logging abstraction.

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = &logger{}
	Info  = &logger{}
	Stats = &logger{}
)

pdfcpu's 3 defined loggers.

Functions

func DisableLoggers

func DisableLoggers()

DisableLoggers turns off all logging.

func SetDebugLogger

func SetDebugLogger(log Logger)

SetDebugLogger sets the debug logger.

func SetDefaultDebugLogger

func SetDefaultDebugLogger()

SetDefaultDebugLogger sets the default debug logger.

func SetDefaultInfoLogger

func SetDefaultInfoLogger()

SetDefaultInfoLogger sets the default info logger.

func SetDefaultLoggers

func SetDefaultLoggers()

SetDefaultLoggers sets all loggers to their default logger.

func SetDefaultStatsLogger

func SetDefaultStatsLogger()

SetDefaultStatsLogger sets the default stats logger.

func SetInfoLogger

func SetInfoLogger(log Logger)

SetInfoLogger sets the info logger.

func SetStatsLogger

func SetStatsLogger(log Logger)

SetStatsLogger sets the stats logger.

Types

type Logger

type Logger interface {

	// Printf logs a formatted string.
	Printf(format string, args ...interface{})

	// Println logs a line.
	Println(args ...interface{})

	// Fatalf is equivalent to Printf() followed by a program abort.
	Fatalf(format string, args ...interface{})

	// Fatalln is equivalent to Println() followed by a progam abort.
	Fatalln(args ...interface{})
}

Logger defines an interface for logging messages.

Jump to

Keyboard shortcuts

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