[SERVER-74968] Create a trait customization point for user-defined types to control stringification used for logging Created: 16/Mar/23  Updated: 29/Oct/23  Resolved: 21/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Mathis Bessa Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-74485 Always include tenant in db name attr... Closed
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2023-04-03
Participants:

 Description   

We use detection idiom to force use of a toString member, a toString nonmember, etc... in some order.
There should be a way for user-defined types to provide an explicit method of log-stringification, as toString might not be appropriate.
It is a bad fit for DatabaseName, for example, at least during the transition to tenantId-augmented DatabaseNames.

Requires a relatively simple extension to the detection logic in logv2/attribute_storage.h



 Comments   
Comment by Githook User [ 21/Mar/23 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-74968 add toStringForLogging as an ADL hook
Branch: master
https://github.com/mongodb/mongo/commit/88830eb62f1ec2eca2bf95e093a01129e5c0bd77

Generated at Thu Feb 08 06:29:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.