log

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: BSD-2-Clause, ISC Imports: 6 Imported by: 10

Documentation

Overview

Package syslog is a syslog-type facility for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(args ...interface{})

func Alertf

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

func Alertln

func Alertln(args ...interface{})

func ChangePriority

func ChangePriority(level string) error

func Crit

func Crit(args ...interface{})

func Critf

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

func Critln

func Critln(args ...interface{})

func Debug

func Debug(args ...interface{})

func Debugf

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

func Debugln

func Debugln(args ...interface{})

func Emerg

func Emerg(args ...interface{})

func Emergf

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

func Emergln

func Emergln(args ...interface{})

func Err

func Err(args ...interface{})

func Errf

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

func Errln

func Errln(args ...interface{})

func Fatal

func Fatal(args ...interface{})

func FatalError added in v1.7.2

func FatalError(err error, message string)

FatalError will only execute if err != nil. If it does, it will print the message (append the error) and exit the program.

func Fatalf

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

func Info

func Info(args ...interface{})

func Infof

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

func Infoln

func Infoln(args ...interface{})

func Notice

func Notice(args ...interface{})

func Noticef

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

func Noticeln

func Noticeln(args ...interface{})

func Setup

func Setup(opts *Options) error

func Spew

func Spew(args ...interface{})

Spew will pretty print the args if the logger is set to DEBUG priority.

func Warning

func Warning(args ...interface{})

func Warningf

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

func Warningln

func Warningln(args ...interface{})

Types

type Options

type Options struct {
	Level        string
	Tag          string
	Facility     string
	WriteSyslog  bool
	WriteConsole bool
}

func DefaultDebugOptions

func DefaultDebugOptions(tag string, withSyslog bool) *Options

DefaultDebugOptions returns a sane set of debug defaults for syslog, using the program name as the tag name. withSyslog controls whether logs should be sent to syslog, too.

func DefaultOptions

func DefaultOptions(tag string, withSyslog bool) *Options

DefaultOptions returns a sane set of defaults for syslog, using the program name as the tag name. withSyslog controls whether logs should be sent to syslog, too.

Jump to

Keyboard shortcuts

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