PSA: Please wrap "```" around logs in Github issues

25 views
Skip to first unread message

Jens Alfke

unread,
Jan 16, 2014, 1:18:37 PM1/16/14
to mobile-c...@googlegroups.com
Hey folks,

When you paste a log or backtrace into a Github issue, please put a line of three back-quotes before and after it. That tells Github's Markdown parser to treat it as pre-formatted text and ignore any special characters like "_" or "*" in it. It also stops it from misinterpreting a Cocoa stack frame index (a "#" followed by a number) as a reference to another issue — this is particularly awful because it spams links to it all over the low-numbered bugs in the project and there's no way to remove them. :(

[Or, if the dump is really long, consider pasting it into a Gist or Pastie or whatever and just linking to it.]

Example of doing it right (from this issue):
```
19:35:15.805410 HTTP:  #249: POST /db/_bulk_docs
2014/01/16 19:35:15 http: panic serving 127.0.0.1:36089: interface conversion: interface is nil, not float64
goroutine 333 [running]:
net/http.func·007()
/usr/local/go/src/pkg/net/http/server.go:1022 +0xac
github.com/couchbaselabs/sync_gateway/db.ParseRevisions(0xc201464200, 0x79cc60, 0xc2005b3cf0, 0xc2005b3ce0)
/home/andrey/couchbase_source/sync_gateway/src/github.com/couchbaselabs/sync_gateway/db/revtree.go:327 +0x1bf
github.com/couchbaselabs/sync_gateway/rest.(*handler).handleBulkDocs(0xc2013f6de0, 0xc200b24ce0, 0x0)
```

Without the back-quotes, this text gets messed up — note that some of the "_"s were hidden but caused the text after them to go italic:

19:35:15.805410 HTTP: #249: POST /db/bulkdocs
2014/01/16 19:35:15 http: panic serving 127.0.0.1:36089: interface conversion: interface is nil, not float64
goroutine 333 [running]:
net/http.func·007()
/usr/local/go/src/pkg/net/http/server.go:1022 +0xac
github.com/couchbaselabs/sync_gateway/db.ParseRevisions(0xc201464200, 0x79cc60, 0xc2005b3cf0, 0xc2005b3ce0)
/home/andrey/couchbase_source/sync_gateway/src/github.com/couchbaselabs/sync_gateway/db/revtree.go:327 +0x1bf
github.com/couchbaselabs/sync_gateway/rest.(handler).handleBulkDocs(0xc2013f6de0, 0xc200b24ce0, 0x0)
/home/andrey/couchbase_source/sync_gateway/src/github.com/couchbaselabs/sync_gateway/rest/bulk_api.go:259 +0x8c4
github.com/couchbaselabs/sync_gateway/rest.(
handler).invoke(0xc2013f6de0, 0x9bd570, 0xc200211240, 0xc201200a10)

With them, the text is correct and everything's nicely formatted in monospace:
19:35:15.805410 HTTP:  #249: POST /db/_bulk_docs
2014/01/16 19:35:15 http: panic serving 127.0.0.1:36089: interface conversion: interface is nil, not float64
goroutine 333 [running]:
net/http.func·007()
    /usr/local/go/src/pkg/net/http/server.go:1022 +0xac
github.com/couchbaselabs/sync_gateway/db.ParseRevisions(0xc201464200, 0x79cc60, 0xc2005b3cf0, 0xc2005b3ce0)
    /home/andrey/couchbase_source/sync_gateway/src/github.com/couchbaselabs/sync_gateway/db/revtree.go:327 +0x1bf
github.com/couchbaselabs/sync_gateway/rest.(*handler).handleBulkDocs(0xc2013f6de0, 0xc200b24ce0, 0x0)
    /home/andrey/couchbase_source/sync_gateway/src/github.com/couchbaselabs/sync_gateway/rest/bulk_api.go:259 +0x8c4
github.com/couchbaselabs/sync_gateway/rest.(*handler).invoke(0xc2013f6de0, 0x9bd570, 0xc200211240, 0xc201200a10)
Reply all
Reply to author
Forward
0 new messages