File tree 3 files changed +5
-8
lines changed
3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ This image bundles headless Chrome in the latest version so debugger is ready to
50
50
-q do not show logs on stdout
51
51
-r string
52
52
remote address (default "localhost:9222")
53
- -s shorten requests and responses
53
+ -s max_length
54
+ shorten requests and responses to max_length
54
55
-version
55
56
display version information
56
57
```
Original file line number Diff line number Diff line change 7
7
var (
8
8
flagListen = flag .String ("l" , "localhost:9223" , "listen address" )
9
9
flagRemote = flag .String ("r" , "localhost:9222" , "remote address" )
10
- flagEllipsis = flag .Bool ("s" , false , "shorten requests and responses" )
10
+ flagEllipsis = flag .Int ("s" , 0 , "shorten requests and responses if above length " )
11
11
flagOnce = flag .Bool ("once" , false , "debug single session" )
12
12
flagShowRequests = flag .Bool ("i" , false , "include request frames as they are sent" )
13
13
flagDistributeLogs = flag .Bool ("d" , false , "write logs file per targetId" )
Original file line number Diff line number Diff line change @@ -6,10 +6,6 @@ import (
6
6
"strings"
7
7
)
8
8
9
- const (
10
- ellipsisLength = 80
11
- )
12
-
13
9
func center (message string , length int ) string {
14
10
padding := (length - len (message )) / 2
15
11
@@ -32,8 +28,8 @@ func serialize(value interface{}) string {
32
28
33
29
buff , err := json .Marshal (value )
34
30
if err == nil {
35
- if * flagEllipsis && len (buff ) > ellipsisLength {
36
- return string (buff [:ellipsisLength ]) + "..."
31
+ if * flagEllipsis != 0 && len (buff ) > * flagEllipsis {
32
+ return string (buff [:* flagEllipsis ]) + "..."
37
33
}
38
34
39
35
serialized := string (buff )
You can’t perform that action at this time.
0 commit comments