logger

package
v0.0.0-...-4070c14 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE  int = 0
	Debug int = 1
	Info  int = 2
	Warn  int = 3
	Panic int = 4
)

Variables

This section is empty.

Functions

func Encode

func Encode(sl Syslog) []byte

Types

type Log

type Log struct {
	Date  string
	PID   int
	Level int
	Err   error
	Msg   string
}

type LogFile

type LogFile struct {
	File       *os.File
	Buffer     [][]byte
	BufferSize int
}

func Open

func Open(file string, bufSize int) (*LogFile, error)

func (*LogFile) Clear

func (logFile *LogFile) Clear()

func (*LogFile) Close

func (logFile *LogFile) Close()

func (LogFile) Flush

func (logFile LogFile) Flush()

func (*LogFile) SyslogWrite

func (logFile *LogFile) SyslogWrite(syslog Syslog)

func (*LogFile) Write

func (logFile *LogFile) Write(log Log)

type Syslog

type Syslog struct {
	Severity int
	Facility int
	Time     time.Time
	Tag      string
	HostName string
	Msg      string
}

func SET

func SET(severity, facility int, time time.Time, tag, hostName, msg string) Syslog

Jump to

Keyboard shortcuts

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