equal
deleted
inserted
replaced
9 "log" |
9 "log" |
10 "os" |
10 "os" |
11 "strings" |
11 "strings" |
12 ) |
12 ) |
13 |
13 |
14 type StdLogger struct { |
|
15 } |
|
16 |
|
17 func (s *StdLogger) Log(v ...interface{}) { |
|
18 log.Println(v...) |
|
19 } |
|
20 |
|
21 func (s *StdLogger) Logf(fmt string, v ...interface{}) { |
|
22 log.Printf(fmt, v...) |
|
23 } |
|
24 |
|
25 func init() { |
14 func init() { |
26 logger := &StdLogger{} |
15 // xmpp.Debug = true |
27 // xmpp.Debug = logger |
|
28 xmpp.Info = logger |
|
29 xmpp.Warn = logger |
|
30 } |
16 } |
31 |
17 |
32 // Demonstrate the API, and allow the user to interact with an XMPP |
18 // Demonstrate the API, and allow the user to interact with an XMPP |
33 // server via the terminal. |
19 // server via the terminal. |
34 func main() { |
20 func main() { |