Added message Logging

This commit is contained in:
2021-09-16 15:45:36 +02:00
parent 83bb549c41
commit 9ccd413399
2 changed files with 25 additions and 6 deletions

13
main.go
View File

@@ -1,6 +1,7 @@
package main
import (
"fmt"
"log"
"time"
@@ -8,6 +9,8 @@ import (
xmppService "github.com/xmpploadtesting/services"
)
var layout = "2006-01-02T15:04:05.000Z"
func main() {
// LOAD APPLICATION CONFIGURATION
@@ -25,13 +28,21 @@ func main() {
// Send online presence stanza in go rutines
go func(xmppClient xmppService.XMPPClient) {
log.Printf("online presence stanza FOR %v", xmppClient.Config.Jid)
log.Printf("Online presence stanza FOR %v", xmppClient.Config.Jid)
err := xmppService.SendOnlinePresenceStanza(xmppClient.Client, xmppClient.Config.Jid)
if err != nil {
log.Printf("There was an error while sending online presence stanza %v", err)
return
}
str := "2014-11-12T11:45:26.371Z"
t, err := time.Parse(layout, str)
if err != nil {
fmt.Println(err)
}
fmt.Println(t)
}(xmppClient)
}