forked from ghaoo/rboot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rboot.go
38 lines (29 loc) · 778 Bytes
/
rboot.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"github.com/ri0day/rboot"
_ "github.com/ri0day/rboot/adapter"
"github.com/ri0day/rboot/brain/leveldb"
_ "github.com/ri0day/rboot/demo/plugins"
"github.com/sirupsen/logrus"
)
func main() {
bot := rboot.New()
bot.SetBrain(leveldb.NewLevelDB())
bot.Go()
}
func init() {
logrus.SetLevel(logrus.TraceLevel)
logrus.SetFormatter(&logrus.TextFormatter{
ForceColors: true,
})
/*logfile := filepath.Join(os.Getenv("CACHE_PATH"), "log/go.log")
writer, _ := rotatelogs.New(
logfile+".%Y%m%d",
rotatelogs.WithLinkName(logfile),
rotatelogs.WithRotationCount(1000),
rotatelogs.WithRotationTime(time.Duration(24)*time.Hour),
)
logrus.SetFormatter(&logrus.JSONFormatter{})
logrus.SetOutput(writer)
logrus.SetLevel(logrus.TraceLevel)*/
}