Added message Logging
This commit is contained in:
13
main.go
13
main.go
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user