summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-06-20 01:14:54 -0400
committerUnknown <joe2010xtmf@163.com>2014-06-20 01:14:54 -0400
commit8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b (patch)
treef96bf4166b78a123997a3eb3026cb347b5c3bcc6 /modules
parent6c8d630bef3a58860237856c648e56f4b9cea97d (diff)
downloadgitea-8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b.tar.gz
gitea-8bfa7ae7453e56191aa6f7de8067d5b6bb5a4a8b.zip
Remove qiniu/log
Diffstat (limited to 'modules')
-rw-r--r--modules/log/log.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/log/log.go b/modules/log/log.go
index a62baad16e..24f0442d1e 100644
--- a/modules/log/log.go
+++ b/modules/log/log.go
@@ -6,13 +6,16 @@
package log
import (
+ "fmt"
"os"
+ "path"
"github.com/gogits/logs"
)
var (
- loggers []*logs.BeeLogger
+ loggers []*logs.BeeLogger
+ GitLogger *logs.BeeLogger
)
func init() {
@@ -38,6 +41,12 @@ func NewLogger(bufLen int64, mode, config string) {
}
}
+func NewGitLogger(logPath string) {
+ os.MkdirAll(path.Dir(logPath), os.ModePerm)
+ GitLogger = logs.NewLogger(0)
+ GitLogger.SetLogger("file", fmt.Sprintf(`{"level":0,"filename":"%s","rotate":false}`, logPath))
+}
+
func Trace(format string, v ...interface{}) {
for _, logger := range loggers {
logger.Trace(format, v...)