Skip to content
This repository was archived by the owner on Mar 21, 2019. It is now read-only.
 
 

Repository files navigation

log

GoDoc

简体中文

Installation

go get github.com/lunny/log

Features

  • Add color support for unix console
  • Implemented dbwriter to save log to database
  • Implemented FileWriter to save log to file by date or time.
  • Location configuration

Example

For Single File:

f, _ := os.Create("my.log")
log.Std.SetOutput(f)

For Multiple Writer:

f, _ := os.Create("my.log")
log.Std.SetOutput(io.MultiWriter(f, os.Stdout))

For log files by date or time:

w := log.NewFileWriter(log.FileOptions{
    ByType:log.ByDay,
    Dir:"./logs",
})
log.Std.SetOutput(w)

About

This repo is an extension of Golang log.

LICENSE

BSD License http://creativecommons.org/licenses/BSD/

About

Moved to https://gitea.com/lunny/log

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages