debug to verbose logs
parent
3adcee2fbe
commit
62b413c033
|
|
@ -77,7 +77,7 @@
|
|||
"Once": false,
|
||||
"Brokers": {
|
||||
"UseZips": true,
|
||||
"RadiusMiles": 100,
|
||||
"RadiusMiles": 300,
|
||||
"NTG": {
|
||||
"Enabled": true,
|
||||
"JobInfo": true,
|
||||
|
|
|
|||
12
main.go
12
main.go
|
|
@ -63,15 +63,15 @@ func _main() error {
|
|||
}
|
||||
|
||||
func matrixrecv() error {
|
||||
logtr.Debugf("checking matrix...")
|
||||
defer logtr.Debugf("/checking matrix...")
|
||||
logtr.Verbosef("checking matrix...")
|
||||
defer logtr.Verbosef("/checking matrix...")
|
||||
sender := message.NewMatrix()
|
||||
messages, err := sender.Receive()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
func() {
|
||||
logtr.Debugf("looking for help")
|
||||
logtr.Verbosef("looking for help")
|
||||
printed := false
|
||||
for _, msg := range messages {
|
||||
if !strings.HasPrefix(msg.Content, "!help") {
|
||||
|
|
@ -100,7 +100,7 @@ func matrixrecv() error {
|
|||
}
|
||||
}()
|
||||
func() {
|
||||
logtr.Debugf("looking for zips")
|
||||
logtr.Verbosef("looking for zips")
|
||||
db := config.Get().DB()
|
||||
zips := map[string]map[string]struct{}{}
|
||||
for _, msg := range messages {
|
||||
|
|
@ -124,7 +124,7 @@ func matrixrecv() error {
|
|||
setNewZips(zips)
|
||||
}()
|
||||
func() {
|
||||
logtr.Debugf("looking for states")
|
||||
logtr.Verbosef("looking for states")
|
||||
db := config.Get().DB()
|
||||
states := map[string]map[config.State]struct{}{}
|
||||
for _, msg := range messages {
|
||||
|
|
@ -148,7 +148,7 @@ func matrixrecv() error {
|
|||
setNewStates(states)
|
||||
}()
|
||||
func() {
|
||||
logtr.Debugf("looking for pauses")
|
||||
logtr.Verbosef("looking for pauses")
|
||||
db := config.Get().DB()
|
||||
pauses := map[string]time.Time{}
|
||||
for _, msg := range messages {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ func (m *Matrix) Receive() ([]Message, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
logtr.Debugf("%s => {Start:%s End:%v};; %v, (%d)", m.Continuation(), result.Start, result.End, err, len(result.Chunk))
|
||||
logtr.Verbosef("%s => {Start:%s End:%v};; %v, (%d)", m.Continuation(), result.Start, result.End, err, len(result.Chunk))
|
||||
m.continuation = result.End
|
||||
for _, event := range result.Chunk {
|
||||
logtr.Verbosef("matrix event: %+v", event)
|
||||
|
|
@ -100,7 +100,7 @@ func (m *Matrix) Receive() ([]Message, error) {
|
|||
}
|
||||
}
|
||||
clientChange := regexp.MustCompile("@[a-z]+$")
|
||||
logtr.Debugf("rewriting messages based on @abc")
|
||||
logtr.Verbosef("rewriting messages based on @abc")
|
||||
for i := range messages {
|
||||
if found := clientChange.FindString(messages[i].Content); found != "" {
|
||||
messages[i].Content = strings.TrimSpace(strings.ReplaceAll(messages[i].Content, found, ""))
|
||||
|
|
@ -114,7 +114,7 @@ func (m *Matrix) Receive() ([]Message, error) {
|
|||
}
|
||||
messages[i].Content = strings.TrimSpace(messages[i].Content)
|
||||
}
|
||||
logtr.Debugf("rewriting messages based on ! CoMmAnD ...")
|
||||
logtr.Verbosef("rewriting messages based on ! CoMmAnD ...")
|
||||
for i := range messages {
|
||||
if strings.HasPrefix(messages[i].Content, "!") {
|
||||
messages[i].Content = "!" + strings.TrimSpace(messages[i].Content[1:])
|
||||
|
|
@ -231,7 +231,7 @@ func (m Matrix) SendImageTracked(uri string) (string, error) {
|
|||
}
|
||||
publicURI := mediaUpload.ContentURI
|
||||
resp, err := c.SendImage(m.room, "img", publicURI)
|
||||
logtr.Debugf("sent image %s => %s: %+v", uri, publicURI, resp)
|
||||
logtr.Verbosef("sent image %s => %s: %+v", uri, publicURI, resp)
|
||||
return resp.EventID, err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue