httplog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Normal 普通模式(所有日志写到同一个文件)
	Normal = iota
	// Date 日期分割(按天分割日志)
	Date
)

Variables

This section is empty.

Functions

func Format

func Format(c *pike.Context, tags []*Tag, startedAt time.Time) string

Format 格式化访问日志信息

Types

type Console

type Console struct {
}

Console 输出至控制台

func (*Console) Close

func (c *Console) Close() error

Close 关闭console

func (*Console) Write

func (c *Console) Write(buf []byte) error

Write 写日志

type FileWriter

type FileWriter struct {
	Path     string
	Category int
	// contains filtered or unexported fields
}

FileWriter 以文件形式写日志

func (*FileWriter) Close

func (w *FileWriter) Close() error

Close 关闭写文件

func (*FileWriter) Write

func (w *FileWriter) Write(buf []byte) error

Write 写日志

type Tag

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

Tag log tag

func Parse

func Parse(desc []byte) []*Tag

Parse 转换日志的输出格式

type UDPWriter

type UDPWriter struct {
	URI string
	// contains filtered or unexported fields
}

UDPWriter 以UDP的形式写日志

func (*UDPWriter) Close

func (w *UDPWriter) Close() error

Close 关闭udp连接

func (*UDPWriter) Write

func (w *UDPWriter) Write(buf []byte) error

Write 写日志

type Writer

type Writer interface {
	Write(buf []byte) error
	Close() error
}

Writer the writer interface

Jump to

Keyboard shortcuts

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