-
Notifications
You must be signed in to change notification settings - Fork 24
Removing nested trace output from trace.go #168
Conversation
Sample output with Kubernetes kops and example.goglide install && go build -o gps example.go && chmod +x gps && mv gps ~/Workspace/kops && cd ~/Workspace/kops/ && ./gps && rm -rf .repocache; cd - |
Codecov Report@@ Coverage Diff @@
## master #168 +/- ##
==========================================
- Coverage 79.34% 79.28% -0.06%
==========================================
Files 24 24
Lines 3698 3707 +9
==========================================
+ Hits 2934 2939 +5
- Misses 567 570 +3
- Partials 197 198 +1
Continue to review full report at Codecov.
|
Codecov Report@@ Coverage Diff @@
## master #168 +/- ##
==========================================
- Coverage 79.34% 79.05% -0.29%
==========================================
Files 24 24
Lines 3698 3709 +11
==========================================
- Hits 2934 2932 -2
- Misses 567 577 +10
- Partials 197 200 +3
Continue to review full report at Codecov.
|
Huh. Well. Simplest really is best - I think I might like that more than any of the other options I discussed in #129 :) One thing, though - I think it might still be valuable to indent the "inner" rows - things not starting with "select", "attempt", "revisit" or "backtrack". Yes, you can infer it from the counter on the left, but that's not the most useful for visual scanning and grouping. I'd at least like to see if doing it that way provides an improved experience. Also, that leading pipe feels unnecessary now - maybe we can drop that, too. |
trace.go
Outdated
func getprei(i int) string { | ||
var s string | ||
if i < 10 { | ||
s = fmt.Sprintf("(%d) ", i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, might it be safer/better to just use a tab?
1. Remove pipe 2. Indent inner messages over 2 spaces 3. s/3spaces/tab in getprei
@sdboyer Pushed up changes per your review.. Totally agree about the pipe I think I got all of the "inner" messages - but if you could check that would be helpful Also I indented the "inner" messages over 2 spaces.. I tried a few options, and that looked the best. Sample output:
|
trace.go
Outdated
default: | ||
// panic here because this can *only* mean a stupid internal bug | ||
panic(fmt.Sprintf("canary - unknown type passed as first param to traceInfo %T", data)) | ||
panic(fmt.Sprintf("%scanary - unknown type passed as first param to traceInfo %T", innerIndent, data)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need to indent on the panic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good catch - fixed 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still have a %
:P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SMH - Should I squash?
Yep, we have a winner! 🎉 |
Removing nested trace output from trace.go
My first attempt at a PR..
Closes #129
@sdboyer when you get a chance let me know what you think!