Fix log file name format and remove old debug prints

This commit is contained in:
Tulir Asokan 2018-09-20 01:47:24 +03:00
parent 2a0106da26
commit a77084b12e
6 changed files with 5 additions and 8 deletions

2
.gitignore vendored
View file

@ -5,6 +5,8 @@
*.yaml
!example-config.yaml
logs/
plugins/
# Bots under maubot.xyz

View file

@ -51,21 +51,18 @@ func (bot *Bot) Init() {
bot.initServer()
bot.loadPlugins()
bot.createPlugins()
log.Debugln("Init func exit")
}
func (bot *Bot) Start() {
go bot.startClients()
go bot.startServer()
bot.startPlugins()
log.Debugln("Start func exit")
}
func (bot *Bot) Stop() {
bot.stopPlugins()
bot.stopServer()
bot.stopClients()
log.Debugln("Stop func exit")
}
func (bot *Bot) initDatabase() {

View file

@ -82,7 +82,7 @@ func (lc *LogConfig) MarshalYAML() (interface{}, error) {
func CreateLogConfig() LogConfig {
return LogConfig{
Directory: "./logs",
FileNameFormat: "%[1]s-%02[2]d.log",
FileNameFormat: "{{.Date}}-{{.Index}}.log",
TimestampFormat: "Jan _2, 2006 15:04:05",
FileMode: 0600,
FileDateFormat: "2006-01-02",

View file

@ -122,7 +122,6 @@ func (mxc *MatrixClient) LoadCommandSpecs() *MatrixClient {
for _, spec := range specs {
mxc.CommandSpecs[spec.Owner] = spec
}
log.Debugln("Loaded command specs:", mxc.CommandSpecs)
return mxc
}

View file

@ -82,7 +82,6 @@ func (css *CommandSpecStatic) getAllByQuery(query string, args ...interface{}) (
for rows.Next() {
specs = append(specs, css.New().Scan(rows))
}
log.Debugln("getAllByQuery() =", specs)
return
}

View file

@ -5,8 +5,8 @@ database:
logging:
directory: ./logs
file_mode: 0600
print_debug: false
file_name_format: "%[1]s-%02[2]d.log"
print_level: DEBUG
file_name_format: "{{.Date}}-{{.Index}}.log"
file_date_format: 2006-01-02
timestamp_format: Jan _2, 2006 15:04:05