Use the new logging setup from the example program.
authorChris Jones <christian.jones@sri.com>
Sun, 16 Dec 2012 14:37:43 -0700
changeset 101 5d721a565503
parent 100 24231ff0016c
child 102 872e936f9f3f
Use the new logging setup from the example program.
examples/interact.go
--- a/examples/interact.go	Sun Dec 16 14:07:14 2012 -0700
+++ b/examples/interact.go	Sun Dec 16 14:37:43 2012 -0700
@@ -8,10 +8,19 @@
 	xmpp ".."
 	"flag"
 	"fmt"
+	"io"
 	"log"
 	"os"
 )
 
+func init() {
+	r, w := io.Pipe()
+	go io.Copy(os.Stdout, r)
+	xmpp.Debug = log.New(w, "debug: ", 0)
+	xmpp.Info = log.New(w, "info: ", 0)
+	xmpp.Warn = log.New(w, "warn: ", 0)
+}
+
 // Demonstrate the API, and allow the user to interact with an XMPP
 // server via the terminal.
 func main() {