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")
Expand ▾ Collapse ▴

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)

        Source Files