mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Fix log file name format and remove old debug prints
This commit is contained in:
parent
2a0106da26
commit
a77084b12e
2
.gitignore
vendored
2
.gitignore
vendored
@ -5,6 +5,8 @@
|
|||||||
*.yaml
|
*.yaml
|
||||||
!example-config.yaml
|
!example-config.yaml
|
||||||
|
|
||||||
|
logs/
|
||||||
|
|
||||||
plugins/
|
plugins/
|
||||||
|
|
||||||
# Bots under maubot.xyz
|
# Bots under maubot.xyz
|
||||||
|
@ -51,21 +51,18 @@ func (bot *Bot) Init() {
|
|||||||
bot.initServer()
|
bot.initServer()
|
||||||
bot.loadPlugins()
|
bot.loadPlugins()
|
||||||
bot.createPlugins()
|
bot.createPlugins()
|
||||||
log.Debugln("Init func exit")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bot *Bot) Start() {
|
func (bot *Bot) Start() {
|
||||||
go bot.startClients()
|
go bot.startClients()
|
||||||
go bot.startServer()
|
go bot.startServer()
|
||||||
bot.startPlugins()
|
bot.startPlugins()
|
||||||
log.Debugln("Start func exit")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bot *Bot) Stop() {
|
func (bot *Bot) Stop() {
|
||||||
bot.stopPlugins()
|
bot.stopPlugins()
|
||||||
bot.stopServer()
|
bot.stopServer()
|
||||||
bot.stopClients()
|
bot.stopClients()
|
||||||
log.Debugln("Stop func exit")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bot *Bot) initDatabase() {
|
func (bot *Bot) initDatabase() {
|
||||||
|
@ -82,7 +82,7 @@ func (lc *LogConfig) MarshalYAML() (interface{}, error) {
|
|||||||
func CreateLogConfig() LogConfig {
|
func CreateLogConfig() LogConfig {
|
||||||
return LogConfig{
|
return LogConfig{
|
||||||
Directory: "./logs",
|
Directory: "./logs",
|
||||||
FileNameFormat: "%[1]s-%02[2]d.log",
|
FileNameFormat: "{{.Date}}-{{.Index}}.log",
|
||||||
TimestampFormat: "Jan _2, 2006 15:04:05",
|
TimestampFormat: "Jan _2, 2006 15:04:05",
|
||||||
FileMode: 0600,
|
FileMode: 0600,
|
||||||
FileDateFormat: "2006-01-02",
|
FileDateFormat: "2006-01-02",
|
||||||
|
@ -122,7 +122,6 @@ func (mxc *MatrixClient) LoadCommandSpecs() *MatrixClient {
|
|||||||
for _, spec := range specs {
|
for _, spec := range specs {
|
||||||
mxc.CommandSpecs[spec.Owner] = spec
|
mxc.CommandSpecs[spec.Owner] = spec
|
||||||
}
|
}
|
||||||
log.Debugln("Loaded command specs:", mxc.CommandSpecs)
|
|
||||||
return mxc
|
return mxc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,6 @@ func (css *CommandSpecStatic) getAllByQuery(query string, args ...interface{}) (
|
|||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
specs = append(specs, css.New().Scan(rows))
|
specs = append(specs, css.New().Scan(rows))
|
||||||
}
|
}
|
||||||
log.Debugln("getAllByQuery() =", specs)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ database:
|
|||||||
logging:
|
logging:
|
||||||
directory: ./logs
|
directory: ./logs
|
||||||
file_mode: 0600
|
file_mode: 0600
|
||||||
print_debug: false
|
print_level: DEBUG
|
||||||
file_name_format: "%[1]s-%02[2]d.log"
|
file_name_format: "{{.Date}}-{{.Index}}.log"
|
||||||
file_date_format: 2006-01-02
|
file_date_format: 2006-01-02
|
||||||
timestamp_format: Jan _2, 2006 15:04:05
|
timestamp_format: Jan _2, 2006 15:04:05
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user