[SERVER-13367] Specialize operator<<(std::ostream&, BSONType) Created: 26/Mar/14  Updated: 02/Sep/16  Resolved: 15/Aug/16

Status: Closed
Project: Core Server
Component/s: Internal Code, Usability
Affects Version/s: None
Fix Version/s: 3.3.12

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Adam Chelminski (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-10367 Error messages showing bson type mism... Closed
Related
is related to SERVER-13362 Need better messaging in BSONElement:... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2016-08-26
Participants:

 Description   

We could make it print the type names rather than (or in addition to) the number. Right now, it requires extra effort to produce good error and log messages and it is often skipped.



 Comments   
Comment by Githook User [ 15/Aug/16 ]

Author:

{u'username': u'adamchel', u'name': u'Adam Chelminski', u'email': u'adam.chelminski@mongodb.com'}

Message: SERVER-13367 Specialize operator<< for BSONType for std::ostream, LogstreamBuilder, and StringBuilder
Branch: master
https://github.com/mongodb/mongo/commit/9175ab505d970a6e97733a28e16496426d10f3ee

Comment by Mathias Stearn [ 14/Jan/15 ]

schwerin, I don't think enum classes can have methods. Also I hold out hope of logging one day working with streaming rather than requiring toString() methods. I actually don't think it would be too hard to make it support both.

Comment by Andy Schwerin [ 14/Jan/15 ]

redbeard0531, since the logging system (mysteriously) does not use std::ostream by default, but rather uses LogstreamBuilder, maybe we could turn BSONType into an enum class and give it a toString() method?

Generated at Thu Feb 08 03:31:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.