summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2022-07-08 16:22:43 +0000
committercyberta <cyberta@riseup.net>2022-07-08 16:22:43 +0000
commit1b48a86953be93f5a526ec1c746c07a0e2feaa87 (patch)
tree57fb45931b018331cbc5aa74ee7326e59b61fbea
parentfeff527c00e56b2da3584360f81495e003034f1f (diff)
parentfbe1c1ec72293edcf61d7293f330e3d0ef6f2130 (diff)
Merge branch 'gotest-ci' into 'main'
Fix error reported by go test See merge request leap/obfsvpn!18
-rw-r--r--client/client.go11
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...)
}