1
1
mirror of https://github.com/go-gitea/gitea synced 2024-10-31 23:34:25 +00:00
gitea/vendor/gitea.com/lunny/log
6543 70ea2300ca
[Vendor] update macaron related (#13409)
* Vendor: update gitea.com/macaron/session to a177a270

* make vendor

* Vendor: update gitea.com/macaron/macaron to 0db5d458

* make vendor

* Vendor: update gitea.com/macaron/cache to 905232fb

* make vendor

* Vendor: update gitea.com/macaron/i18n to 4ca3dd0c

* make vendor

* Vendor: update gitea.com/macaron/gzip to efa5e847

* make vendor

* Vendor: update gitea.com/macaron/captcha to e8597820

* make vendor
2020-11-03 08:04:09 +02:00
..
.gitignore [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
dbwriter.go [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
filewriter.go [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
go.mod [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
go.sum [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
LICENSE [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
logext.go [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
README_CN.md [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00
README.md [Vendor] update macaron related (#13409) 2020-11-03 08:04:09 +02:00

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/