logs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2016 License: MIT Imports: 7 Imported by: 0

README

#logs

##默认格式

[15:04:05.0000] yourlogargs
[15:04:05.0000] yourlogargs
[15:04:05.0000] yourlogargs

##用内置的对象进行日志

logs.Write("[auth]","12","login")

##创建新的对象进行日志

userlog := logs.NewLogs("user")
userlog.Write("hello user")

Documentation

Overview

不需要创建实例对象,直接Write(v ...interface{})就好了

Index

Constants

This section is empty.

Variables

View Source
var (
	Logspath         = "logs/"
	Maxlogsize int64 = 50 << 20 //50M
)

Functions

func Write

func Write(v ...interface{}) (int, error)

Types

type Logs

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

func NewLogs

func NewLogs(kind string) *Logs

创建新的log handle

func (*Logs) GetAbsFilePath

func (l *Logs) GetAbsFilePath() string

获取将要新创建日志的全路径名。

func (*Logs) OpenNextDay

func (l *Logs) OpenNextDay(v ...interface{}) (int, error)

func (*Logs) OpenNextFile

func (l *Logs) OpenNextFile()

func (*Logs) Write

func (l *Logs) Write(v ...interface{}) (int, error)

Jump to

Keyboard shortcuts

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