1
0
Fork 0
forked from forgejo/forgejo

Use Go1.11 module (#5743)

* Migrate to go modules

* make vendor

* Update mvdan.cc/xurls

* make vendor

* Update code.gitea.io/git

* make fmt-check

* Update github.com/go-sql-driver/mysql

* make vendor
This commit is contained in:
Mura Li 2019-03-27 19:15:23 +08:00 committed by Lunny Xiao
parent d578b71d61
commit d77176912b
575 changed files with 63239 additions and 13963 deletions

26
vendor/github.com/lunny/log/.gitignore generated vendored Normal file
View file

@ -0,0 +1,26 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
log.db
*.log
logs
.vscode

49
vendor/github.com/lunny/log/README.md generated vendored Normal file
View file

@ -0,0 +1,49 @@
## log
[![GoDoc](https://godoc.org/github.com/lunny/log?status.png)](https://godoc.org/github.com/lunny/log)
[简体中文](https://github.com/lunny/log/blob/master/README_CN.md)
# 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:
```Go
f, _ := os.Create("my.log")
log.Std.SetOutput(f)
```
For Multiple Writer:
```Go
f, _ := os.Create("my.log")
log.Std.SetOutput(io.MultiWriter(f, os.Stdout))
```
For log files by date or time:
```Go
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/](http://creativecommons.org/licenses/BSD/)

52
vendor/github.com/lunny/log/README_CN.md generated vendored Normal file
View file

@ -0,0 +1,52 @@
## log
[![GoDoc](https://godoc.org/github.com/lunny/log?status.png)](https://godoc.org/github.com/lunny/log)
[English](https://github.com/lunny/log/blob/master/README.md)
# 安装
```
go get github.com/lunny/log
```
# 特性
* 对unix增加控制台颜色支持
* 实现了保存log到数据库支持
* 实现了保存log到按日期的文件支持
* 实现了设置日期的地区
# 例子
保存到单个文件:
```Go
f, _ := os.Create("my.log")
log.Std.SetOutput(f)
```
保存到数据库:
```Go
f, _ := os.Create("my.log")
log.Std.SetOutput(io.MultiWriter(f, os.Stdout))
```
保存到按时间分隔的文件:
```Go
w := log.NewFileWriter(log.FileOptions{
ByType:log.ByDay,
Dir:"./logs",
})
log.Std.SetOutput(w)
```
# 关于
本 Log 是在 golang 的 log 之上的扩展
# LICENSE
BSD License
[http://creativecommons.org/licenses/BSD/](http://creativecommons.org/licenses/BSD/)