logger

package
v0.0.0-...-1f713e5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HAProxyFmtStr         = "haproxy[%d]: %s:%s [%s] %s %s/%s %d/%d/%d/%d/%d %d %d %s %s %s %d/%d/%d/%d/%d %d/%d {%s} {%s} \"%s\"\n"
	BadGatewayMsg         = "Bad Gateway"
	GatewayTimeoutMsg     = "Gateway Timeout"
	ServiceUnavailableMsg = "Service Unavailable"
)

Variables

This section is empty.

Functions

func Debugf

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

func Errorf

func Errorf(fmt string, args ...interface{})

func InitPkgLogger

func InitPkgLogger()

func Printf

func Printf(fmt string, args ...interface{})

Types

type Copier

type Copier struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewCopier

func NewCopier(args ...time.Duration) *Copier

func (*Copier) Copy

func (c *Copier) Copy(dst io.Writer, src io.Reader) (wr int64, err error)

func (*Copier) Shutdown

func (c *Copier) Shutdown()

type HAProxyLogRecord

type HAProxyLogRecord struct {
	http.ResponseWriter
	*http.Request
	// contains filtered or unexported fields
}

func NewHAProxyLogRecord

func NewHAProxyLogRecord(w http.ResponseWriter, r *http.Request, frontendPort string, feConn uint32, acceptDate time.Time) HAProxyLogRecord

func NewShallowHAProxyLogRecord

func NewShallowHAProxyLogRecord(out io.Writer, w http.ResponseWriter, r *http.Request) *HAProxyLogRecord

func (*HAProxyLogRecord) AddResponseHeader

func (r *HAProxyLogRecord) AddResponseHeader(hdr, val string)

func (*HAProxyLogRecord) Copy

func (r *HAProxyLogRecord) Copy(src io.Reader) (err error)

func (*HAProxyLogRecord) CopyHeaders

func (r *HAProxyLogRecord) CopyHeaders(hdrs http.Header)

func (*HAProxyLogRecord) Error

func (r *HAProxyLogRecord) Error(error string, code int)

Responds to the specified request with the provided error.

func (*HAProxyLogRecord) GetResponseHeaders

func (r *HAProxyLogRecord) GetResponseHeaders() http.Header

func (*HAProxyLogRecord) GetResponseStatusCode

func (r *HAProxyLogRecord) GetResponseStatusCode() int

func (*HAProxyLogRecord) Log

func (r *HAProxyLogRecord) Log()

func (*HAProxyLogRecord) PoolUpdateRecord

func (r *HAProxyLogRecord) PoolUpdateRecord(name string, count uint32, beQueue uint64, pTime time.Time)

func (*HAProxyLogRecord) ServerUpdateRecord

func (r *HAProxyLogRecord) ServerUpdateRecord(name string, sQueue uint64, sConn uint32, sTime time.Time)

func (*HAProxyLogRecord) Terminate

func (r *HAProxyLogRecord) Terminate(termState string)

Set's the termination state and log's the request

func (*HAProxyLogRecord) UpdateTr

func (r *HAProxyLogRecord) UpdateTr(resStartTime, resRetTime time.Time)

func (*HAProxyLogRecord) Write

func (r *HAProxyLogRecord) Write(p []byte) (int, error)

func (*HAProxyLogRecord) WriteHeader

func (r *HAProxyLogRecord) WriteHeader(code int)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New() *Logger

func (*Logger) Debugf

func (l *Logger) Debugf(fmt string, args ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(fmt string, args ...interface{})

func (*Logger) Printf

func (l *Logger) Printf(fmt string, args ...interface{})

func (*Logger) Shutdown

func (l *Logger) Shutdown()

Jump to

Keyboard shortcuts

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