[SERVER-66203] Sweep: move MONGO_LOGV2_DEFAULT_COMPONENT definition below includes Created: 03/May/22  Updated: 29/Oct/23  Resolved: 06/May/22

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

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue 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-66202 MONGO_LOGV2_DEFAULT_COMPONENT convent... Closed
Issue split
split from SERVER-52604 Log from anywhere (normalize MONGO_LO... Closed
Problem/Incident
Related
related to SERVER-71926 create linter rule for MONGO_LOGV2_DE... Closed
related to SERVER-71925 move MONGO_LOGV2_DEFAULT_COMPONENT be... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2022-05-16
Participants:
Linked BF Score: 0

 Description   

SERVER-52604 links to a python script that will move all definitions of MONGO_LOGV2_DEFAULT_COMPONENT below the conventional block of includes a the top of .cpp files. After SERVER-52604, this is possible.

Doing this makes it possible for headers to define (and then undef) the macro internally without worrying that another file has already defined it. This could be accomplished with nonstandard push_macro/pop_macro but that's complicated and nonstandard. We can do better.

Doing this also makes a cleaner precompiled header / modules / caching model because headers will not be included multiple times with different values of MONGO_LOGV2_DEFAULT_COMPONENT. It mitigates one definition rule risk by the same logic.

[split from SERVER-52604]

I'm just running a script I already had from last year.
There are some cases where a file needed manual intervention. Not many.



 Comments   
Comment by Githook User [ 06/May/22 ]

Author:

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

Message: SERVER-66203 fix ntservice.cpp after MONGO_LOGV2_DEFAULT_COMPONENT move
Branch: master
https://github.com/mongodb/mongo/commit/bc04b68375642018348ca156bfc7a145b6c4e822

Comment by Githook User [ 06/May/22 ]

Author:

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

Message: SERVER-66203 move MONGO_LOGV2_DEFAULT_COMPONENT below includes
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/dc12b65d6255d99d9126c0be14627a8992f4a295

Comment by Githook User [ 06/May/22 ]

Author:

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

Message: SERVER-66203 move MONGO_LOGV2_DEFAULT_COMPONENT defs below includes
Branch: master
https://github.com/mongodb/mongo/commit/330458e81f9baa3f936d639dc3edbe1a8c4c5a32

Comment by Billy Donahue [ 03/May/22 ]

https://gist.github.com/BillyDonahue/48c2746b9a761e1d1ecc930486d83aa5

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