Git with a cup of tea, painless self-hosted git service Mirror for internal git.with.parts use https://git.with.parts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
gitea/vendor/gitea.com/lunny/log
6543 70ea2300ca
[Vendor] update macaron related (#13409)
4 years ago
..
.gitignore [Vendor] update macaron related (#13409) 4 years ago
LICENSE [Vendor] update macaron related (#13409) 4 years ago
README.md [Vendor] update macaron related (#13409) 4 years ago
README_CN.md [Vendor] update macaron related (#13409) 4 years ago
dbwriter.go [Vendor] update macaron related (#13409) 4 years ago
filewriter.go [Vendor] update macaron related (#13409) 4 years ago
go.mod [Vendor] update macaron related (#13409) 4 years ago
go.sum [Vendor] update macaron related (#13409) 4 years ago
logext.go [Vendor] update macaron related (#13409) 4 years ago

README.md

log

GoDoc

简体中文

Installation

go get gitea.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/