1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-06-27 15:36:48 +00:00
seafile-server/notification-server/logger.go
feiniks d6f6127641
Add notification server (#535)
* Add notification server of go

Modify path of pkg

Send notification for update-repo event

Delete client pkg and use reflect select to send message

Modify output of log

Add formatter of log

Add jwt authentication

go add get jwt token api

CI support compile libjwt

Get group users from database

* Add ping to test mysql is alive

Co-authored-by: 杨赫然 <heran.yang@seafile.com>
2022-12-16 15:29:01 +08:00

20 lines
408 B
Go

package main
import (
log "github.com/sirupsen/logrus"
)
const (
timestampFormat = "2006/01/02 15:04:05 "
)
type LogFormatter struct{}
func (f *LogFormatter) Format(entry *log.Entry) ([]byte, error) {
buf := make([]byte, 0, len(timestampFormat)+len(entry.Message)+1)
buf = entry.Time.AppendFormat(buf, timestampFormat)
buf = append(buf, entry.Message...)
buf = append(buf, '\n')
return buf, nil
}