logger

package
v0.9.13 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package logger is a wrapper around UNIX syslog, so that it also may be wrapped with something else for Windows (Sadly, the stdlib log/syslog is frozen, and there is no Windows implementation.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(s string) error

Alert returns a log Alert error

func LogClose

func LogClose() error

LogClose closes the log Writer.

func LogCrit

func LogCrit(s string) error

LogCrit returns a log Alert error

func LogDebug

func LogDebug(s string) error

LogDebug returns a log Debug error

func LogEmerg

func LogEmerg(s string) error

LogEmerg returns a log Emerg error

func LogErr

func LogErr(s string) error

LogErr returns a log Err error

func LogInfo

func LogInfo(s string) error

LogInfo returns a log Info error

func LogNotice

func LogNotice(s string) error

LogNotice returns a log Notice error

func LogWarning

func LogWarning(s string) error

LogWarning returns a log Warning error

func LogWrite

func LogWrite(b []byte) (int, error)

LogWrite writes to the logger at default level

Types

type Priority

type Priority = sl.Priority

Priority is the logger priority

const (

	// From /usr/include/sys/syslog.h.
	// These are the same on Linux, BSD, and OS X.
	LOG_EMERG Priority = iota
	LOG_ALERT
	LOG_CRIT
	LOG_ERR
	LOG_WARNING
	LOG_NOTICE
	LOG_INFO
	LOG_DEBUG
)

nolint: golint

const (

	// From /usr/include/sys/syslog.h.
	// These are the same up to LOG_FTP on Linux, BSD, and OS X.
	LOG_KERN Priority = iota << 3
	LOG_USER
	LOG_MAIL
	LOG_DAEMON
	LOG_AUTH
	LOG_SYSLOG
	LOG_LPR
	LOG_NEWS
	LOG_UUCP
	LOG_CRON
	LOG_AUTHPRIV
	LOG_FTP

	LOG_LOCAL0
	LOG_LOCAL1
	LOG_LOCAL2
	LOG_LOCAL3
	LOG_LOCAL4
	LOG_LOCAL5
	LOG_LOCAL6
	LOG_LOCAL7
)

nolint: golint

type Writer

type Writer = sl.Writer

Writer is a syslog Writer

func New

func New(flags Priority, tag string) (w *Writer, e error)

New returns a new log Writer.

Jump to

Keyboard shortcuts

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