log

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(message string)

Debug for logging any messages useful for debugging applications.

func Debugf

func Debugf(message string, v ...interface{})

Debugf for logging any messages useful for debugging applications.

func Error

func Error(message string)

Error for logging any error messages where the application is able to recover from.

func Errorf

func Errorf(message string, v ...interface{})

Errorf for logging any error messages where the application is able to recover from.

func Fatal

func Fatal(message string)

Fatal for logging any fatal messages where the application is unable to recover from.

func Fatalf

func Fatalf(message string, v ...interface{})

Fatalf for logging any fatal messages where the application is unable to recover from.

func Info

func Info(message string)

Info for logging any messages about useful information.

func Infof

func Infof(message string, v ...interface{})

Infof for logging any messages about useful information.

func Shutdown

func Shutdown()

Shutdown shuts down the log package.

func Startup

func Startup(options *Options) error

Startup initialises the log package.

func Warning

func Warning(message string)

Warning for logging any warning messages. Example, bad practices.

func Warningf

func Warningf(message string, v ...interface{})

Warningf for logging any warning messages. Example, bad practices.

Types

type Data

type Data struct {
	Level     string `json:"level"`
	Prefix    string `json:"prefix"`
	Timestamp string `json:"timestamp"`
	Message   string `json:"message"`
}

Data holds all the data stored in a log.

type Options

type Options struct {
	LogDebug   bool
	LogInfo    bool
	LogWarning bool
	LogError   bool
	LogFatal   bool
	Prefix     string
	Directory  string
}

Options holds all the possible options that can be set when loggin.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions are the default options that can be set when logging.

Jump to

Keyboard shortcuts

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