op

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsole

func NewConsole(l zerolog.Level) zerolog.LevelWriter

create ConsoleWriter returning as LoggerInterface.

func NewFileWriter

func NewFileWriter(w *rotatefile.Writer, lv zerolog.Level) zerolog.LevelWriter

NewFileWriter NewFileWriter

func NewSmtpWriter

func NewSmtpWriter(username, password, host, subject string, sendto []string, level zerolog.Level) zerolog.LevelWriter

create smtp writer.

Types

type Brush

type Brush func([]byte) []byte

func NewBrush

func NewBrush(color string) Brush

type ConsoleWriter

type ConsoleWriter struct {
	Level zerolog.Level
	// contains filtered or unexported fields
}

ConsoleWriter implements LoggerInterface and writes messages to terminal.

func (*ConsoleWriter) Write

func (cw *ConsoleWriter) Write(p []byte) (n int, err error)

func (*ConsoleWriter) WriteLevel

func (cw *ConsoleWriter) WriteLevel(l zerolog.Level, p []byte) (n int, err error)

type FileLogWriter

type FileLogWriter struct {
	Level zerolog.Level `json:"level"`
	// contains filtered or unexported fields
}

FileLogWriter implements LevelWriter.

func (*FileLogWriter) Write

func (w *FileLogWriter) Write(p []byte) (n int, err error)

WriteLevel implements io.Writer.

func (*FileLogWriter) WriteLevel

func (w *FileLogWriter) WriteLevel(l zerolog.Level, p []byte) (n int, err error)

WriteLevel implements LevelWriter.

type SmtpWriter

type SmtpWriter struct {
	Username           string        `json:"Username"`
	Password           string        `json:"password"`
	Host               string        `json:"Host"`
	Subject            string        `json:"subject"`
	RecipientAddresses []string      `json:"sendTos"`
	Level              zerolog.Level `json:"level"`
	// contains filtered or unexported fields
}

smtpWriter implements LoggerInterface and is used to send emails via given SMTP-server.

func (*SmtpWriter) Write

func (s *SmtpWriter) Write(b []byte) (int, error)

func (*SmtpWriter) WriteLevel

func (s *SmtpWriter) WriteLevel(l zerolog.Level, p []byte) (n int, err error)

write message in smtp writer. it will send an email with subject and only this message.

Jump to

Keyboard shortcuts

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