[CDRIVER-620] Runtime flag for TRACE Created: 21/Apr/15 Updated: 17/Aug/15 Resolved: 29/Jul/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.2-beta0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hannes Magnusson | Assignee: | Hannes Magnusson |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
I love the mongoc tracing, its a godsend. During development of the PHP driver I always compile mongoc with -DMONGOC_TRACE and then at runtime in my log handler I check if I should print these things to stderr, file, or ignore it. I am planning on shipping the driver with tracing enabled as I want to be able to get full debugging logs with a flip of a userland-switch (e.g. no need for the user to recompile anything or jump through hoops). This works fine for all the other log events without any clear performance penalty (-ish, vargs and strdupv_printf()s...) – but in the tracing case, DUMP_BYTES() & DUMP_IOVEC() are painful. It would be fantastic if we could short circuit the DUMP_*() madness, and out of mongoc_log() based on a "config setting". |
| Comments |
| Comment by Githook User [ 05/Aug/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Prevents a much-later crash in the test suite on win32. |
| Comment by Hannes Magnusson [ 29/Jul/15 ] |
|
We wound up with calling the functions: |
| Comment by Githook User [ 29/Jul/15 ] |
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: Tracing still needs to be compiled in! |
| Comment by A. Jesse Jiryu Davis [ 13/Jul/15 ] |
|
Should actually be "mongoc_trace_enable". |
| Comment by Hannes Magnusson [ 22/Apr/15 ] |
|
C API – otherwise our users would have to restart their webserver cluster which isn't optimal. |
| Comment by A. Jesse Jiryu Davis [ 22/Apr/15 ] |
|
OK, I'll try to get this in by 1.2 final. An environment variable like DISABLE_MONGOC_TRACE, or a C API like mongoc_enable_trace(bool)? |
| Comment by Hannes Magnusson [ 22/Apr/15 ] |
|
jesse If you have the time it'd be appreciated - I fear I don't have the time before the 1.2 ship date. |
| Comment by A. Jesse Jiryu Davis [ 22/Apr/15 ] |
|
Sounds good, would you like to do it or prefer I do? |