Browse Source

Wire up the mautrix logger to logrus

Really makes debugging a lot easier
pull/369/head
Janne Heß 2 years ago
parent
commit
fcc771f3e3
No known key found for this signature in database GPG Key ID: 69165158F05265DF
  1. 10
      clients/clients.go

10
clients/clients.go

@ -55,6 +55,15 @@ func (c *Clients) Update(config api.ClientConfig) (api.ClientConfig, error) {
return old.config, err
}
type MautrixLogger struct{}
func (d *MautrixLogger) Debugfln(message string, args ...interface{}) {
log.Debugf(message, args...)
}
func (d *MautrixLogger) Warnfln(message string, args ...interface{}) {
log.Warnf(message, args...)
}
// Start listening on client /sync streams
func (c *Clients) Start() error {
configs, err := c.db.LoadMatrixClientConfigs()
@ -335,6 +344,7 @@ func (c *Clients) initClient(botClient *BotClient) error {
return err
}
client.Logger = &MautrixLogger{}
client.Client = c.httpClient
client.DeviceID = config.DeviceID
if client.DeviceID == "" {

Loading…
Cancel
Save