diff options
-rw-r--r-- | client/client.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/client.go b/client/client.go index 4b10ab2..e67546a 100644 --- a/client/client.go +++ b/client/client.go @@ -42,7 +42,7 @@ func NewClient(kcp bool, socksAddr, obfs4Cert string) *Client { func (c *Client) Start() (bool, error) { defer func() { - c.log("STOPPED", "", nil) + c.log("STOPPED", "") }() if c.IsStarted() { @@ -98,8 +98,11 @@ func (c *Client) log(state string, format string, a ...interface{}) { c.EventLogger.Log(state, fmt.Sprintf(format, a...)) return } + if format == "" { + log.Print(a...) + return + } log.Printf(format, a...) - } func (c *Client) error(format string, a ...interface{}) { @@ -107,6 +110,10 @@ func (c *Client) error(format string, a ...interface{}) { c.EventLogger.Error(fmt.Sprintf(format, a...)) return } + if format == "" { + log.Print(a...) + return + } log.Printf(format, a...) } |