Skip to content

Commit

Permalink
bring back original indention
Browse files Browse the repository at this point in the history
  • Loading branch information
fffw committed Aug 16, 2016
1 parent ea6360c commit 479e161
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/github.com/getlantern/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ func (e *structured) PrintStack(w io.Writer) {
for {
for stackPosition := 0; stackPosition < len(err.callStack); stackPosition++ {
call := err.callStack[stackPosition]
fmt.Fprintf(w, " at %+n (%s:%d)\n", call, call, call)
fmt.Fprintf(w, " at %+n (%s:%d)\n", call, call, call)
}
cause, ok := err.cause.(*structured)
if !ok || cause == nil {
return
}
err = cause
fmt.Fprintf(w, " Caused by: %v\n", err)
fmt.Fprintf(w, "Caused by: %v\n", err)
}
}

Expand Down
34 changes: 17 additions & 17 deletions src/github.com/getlantern/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,23 @@ func TestNewWithCause(t *testing.T) {
buf.WriteByte('\n')
outer.PrintStack(buf)
expected := `Hello World
at github.com/getlantern/errors.TestNewWithCause (errors_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: World
at github.com/getlantern/errors.buildCause (errors_test.go:999)
at github.com/getlantern/errors.TestNewWithCause (errors_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: orld
Caused by: ld
at github.com/getlantern/errors.buildSubSubCause (errors_test.go:999)
at github.com/getlantern/errors.buildSubCause (errors_test.go:999)
at github.com/getlantern/errors.buildCause (errors_test.go:999)
at github.com/getlantern/errors.TestNewWithCause (errors_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: d
at github.com/getlantern/errors.TestNewWithCause (errors_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: World
at github.com/getlantern/errors.buildCause (errors_test.go:999)
at github.com/getlantern/errors.TestNewWithCause (errors_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: orld
Caused by: ld
at github.com/getlantern/errors.buildSubSubCause (errors_test.go:999)
at github.com/getlantern/errors.buildSubCause (errors_test.go:999)
at github.com/getlantern/errors.buildCause (errors_test.go:999)
at github.com/getlantern/errors.TestNewWithCause (errors_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: d
`

assert.Equal(t, expected, replaceNumbers.ReplaceAllString(hidden.Clean(buf.String()), "999"))
Expand Down
30 changes: 15 additions & 15 deletions src/github.com/getlantern/golog/golog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ import (
var (
expectedLog = "SEVERITY myprefix: golog_test.go:999 Hello world\nSEVERITY myprefix: golog_test.go:999 Hello true [cvarA=a cvarB=b op=name root_op=name]\n"
expectedErrorLog = `ERROR myprefix: golog_test.go:999 Hello world [cvarC=c cvarD=d error=Hello %v error_location=github.com/getlantern/golog.TestError (golog_test.go:999) error_text=Hello world error_type=errors.Error op=name root_op=name]
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: world
at github.com/getlantern/golog.errorReturner (golog_test.go:999)
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: world
at github.com/getlantern/golog.errorReturner (golog_test.go:999)
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
ERROR myprefix: golog_test.go:999 Hello true [cvarA=a cvarB=b cvarC=c error=%v %v error_location=github.com/getlantern/golog.TestError (golog_test.go:999) error_text=Hello true error_type=errors.Error op=name999 root_op=name999]
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: Hello
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
Caused by: Hello
at github.com/getlantern/golog.TestError (golog_test.go:999)
at testing.tRunner (testing.go:999)
at runtime.goexit (asm_amd999.s:999)
`
expectedTraceLog = "TRACE myprefix: golog_test.go:999 Hello world\nTRACE myprefix: golog_test.go:999 Hello true\nTRACE myprefix: golog_test.go:999 Gravy\nTRACE myprefix: golog_test.go:999 TraceWriter closed due to unexpected error: EOF\n"
expectedStdLog = expectedLog
Expand Down

0 comments on commit 479e161

Please sign in to comment.