Skip to content

Commit b697c2c

Browse files
committed
fixed codes
1 parent a8c5b55 commit b697c2c

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

_examples/cmdr-simple/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
# Basic example app
22

3+
```bash
4+
# run it as server
5+
go run ./_examples/cmdr-simple/ tcp server
36

7+
# as a client
8+
go run ./_examples/cmdr-simple/ tcp client
9+
# it will make 3 connections to the running server, and close them and exit.
10+
```
411

12+
And, try 'ucp' instead of 'tcp' command.

_examples/cmdr/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
# Basic example app
22

33

4+
```bash
5+
# run it as server
6+
go run ./_examples/cmdr/ tcp server
7+
8+
# as a client
9+
go run ./_examples/cmdr/ tcp client
10+
# it will make 3 connections to the running server, and close them and exit.
11+
```
12+
13+
14+
And, try 'ucp' instead of 'tcp' command.
15+
416

_examples/cmdr/pibufio/bufio.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"time"
1010

1111
"github.com/hedzr/log"
12+
"github.com/hedzr/log/detects"
1213
"gopkg.in/hedzr/errors.v3"
1314

1415
"github.com/hedzr/go-socketlib/_examples/cmdr/opts/codec"
@@ -20,7 +21,7 @@ const (
2021
)
2122

2223
func New() Queue {
23-
var traceEnabled = log.GetDebugMode() || log.GetTraceMode()
24+
var traceEnabled = detects.IsDebugModeEnabled() || detects.IsTraceModeEnabled()
2425
return &iobuf{
2526
err: nil,
2627
packageExtractor: &pe{},

tcp/server/server.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/hedzr/cmdr"
1212
"github.com/hedzr/log"
13+
"github.com/hedzr/log/detects"
1314

1415
"github.com/hedzr/go-socketlib/tcp/base"
1516
)
@@ -43,7 +44,7 @@ func newServer(config *base.Config, preferLogger log.Logger, opts ...Opt) (serve
4344
return
4445
}
4546

46-
so.Infof("Starting server (%v)... cmdr.InDebugging = %v", so.netType, cmdr.InDebugging())
47+
so.Infof("Starting server (%v)... cmdr.InDebugging = %v", so.netType, detects.InDebugging())
4748
so.Tracef(" logging.level: %v", so.Logger.GetLevel())
4849
// so.Infof("Starting server...")
4950

0 commit comments

Comments
 (0)