diff --git a/client.go b/client.go index 71761b6..6de41e8 100644 --- a/client.go +++ b/client.go @@ -187,6 +187,19 @@ func New(config Config) *Client { return c } +// String returns a brief description of the current client state. +func (c *Client) String() string { + var connected bool + if c.conn != nil { + connected = c.conn.connected + } + + return fmt.Sprintf( + "", + c.initTime.String(), c.Handlers.Len(), connected, c.reconnecting, c.tries, + ) +} + // Connect attempts to connect to the given IRC server func (c *Client) Connect() error { // Clean up any old running stuff. diff --git a/handler.go b/handler.go index 2c6f8de..6187e6e 100644 --- a/handler.go +++ b/handler.go @@ -120,7 +120,7 @@ func (c *Caller) String() string { } c.mu.RUnlock() - return fmt.Sprintf("", c.Len(), total) + return fmt.Sprintf("", c.Len(), total) } const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"