[SERVER-41552] LogStreamBuilder unconstrained operator<< doesn't cover expected set of types. Created: 05/Jun/19 Updated: 27/Jun/19 Resolved: 27/Jun/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | Backlog |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Billy Donahue | Assignee: | Mira Carey |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Sprint: | Service Arch 2019-06-17, Service Arch 2019-07-01 |
| Participants: |
| Description |
|
Among the many overloads of LogStreamBuilder::operator<<,
The problem is that it's not constrained to T for which x.toString() exists. We could probably do much better here. Maybe if x.toString() is valid, we allow this into the overload set. Otherwise, if std::ostream<<x is valid, we do stream()<<x, which a lot of the other overloads do. Otherwise, LogStreamBuilder butts out and doesn't provide an overload for the operator. There's still a chance for x to define its own operator<< for LogStreamBuilder to be found by ADL, but that's not LogStreamBuilder's concern. This strategy would reduce user surprise, and reduce the number of overloads in LogStreamBuilder from its current (insufficient) 24 down to something like 3. |
| Comments |
| Comment by Mira Carey [ 27/Jun/19 ] |
|
Closing this as wontfix, as the cr was more contentious than expected and the value is limited (given our move to a new logging format in future) |