[SERVER-7231] Replace log(int level) statements with LOG(int level) Created: 02/Oct/12  Updated: 11/Jul/16  Resolved: 24/Oct/12

Status: Closed
Project: Core Server
Component/s: Internal Code, Logging
Affects Version/s: 2.2.3
Fix Version/s: 2.2.4, 2.3.1

Type: Bug Priority: Major - P3
Reporter: Ben Becker Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-7331 Optimize mongos performance Closed
Related
is related to SERVER-7233 LOG macro can leak into client code. Closed
Operating System: ALL
Participants:

 Description   

The LOG() macro allows conditional logging without stream evaluation, while log() evaluates the stream regardless of the global log level. The task here is to remove all uses of log(int level) with a level >= 1, and replace them with LOG().

Note that log() messages are ok if they're information and not in a fast path (with some discretion). In the end, we should have the following log functions:

log()
warning()
error()
LOG(int level)

We will get rid of:

log(int n)

As this is a large change, we should focus on one component at a time and submit individual code reviews. A breakdown of the components for this task is forthcoming.



 Comments   
Comment by auto [ 06/Mar/13 ]

Author:

{u'date': u'2012-10-25T21:07:35Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-7231 Fixed cases where LOG(level) macro is used with booleans

Conflicts:
src/mongo/s/strategy_shard.cpp
Branch: v2.2
https://github.com/mongodb/mongo/commit/b444115cb047a296d250d30765220e0540e23047

Comment by auto [ 06/Mar/13 ]

Author:

{u'date': u'2012-10-15T23:42:39Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-7231 Construct log helper variables only when they will be logged
Branch: v2.2
https://github.com/mongodb/mongo/commit/69035fca654edfa038e17d1c4543206c48708f6b

Comment by auto [ 06/Mar/13 ]

Author:

{u'date': u'2012-10-24T17:58:30Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-7231 Removed log(level) functions
Branch: v2.2
https://github.com/mongodb/mongo/commit/61bde93234ed57ce716eabd1c6fbc32b616778b2

Comment by auto [ 06/Mar/13 ]

Author:

{u'date': u'2012-10-24T17:45:27Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-7231 Use LOG(level) macro instead of log(level) function

Conflicts:
src/mongo/client/distlock.cpp
src/mongo/db/geo/haystack.cpp
src/mongo/db/pdfile.cpp
src/mongo/db/queryoptimizer.cpp
src/mongo/db/repl/rs.cpp
src/mongo/s/config.cpp
Branch: v2.2
https://github.com/mongodb/mongo/commit/910e3d71fed12bc5731c652b793183c15dbb0977

Comment by auto [ 06/Mar/13 ]

Author:

{u'date': u'2012-10-11T20:16:04Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-7231 Use ternary operator in LOG() macro and add necessary comparison operators
Branch: v2.2
https://github.com/mongodb/mongo/commit/0b92639ad548a9262bf7ee19dbf66b7478fe09e8

Comment by auto [ 25/Oct/12 ]

Author:

{u'date': u'2012-10-25T14:07:35-07:00', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-7231 Fixed cases where LOG(level) macro is used with booleans
Branch: master
https://github.com/mongodb/mongo/commit/84cb0fe0660384370fa5d07b7fe4c9d1c76c82ac

Comment by auto [ 24/Oct/12 ]

Author:

{u'date': u'2012-10-15T16:42:39-07:00', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-7231 Construct log helper variables only when they will be logged
Branch: master
https://github.com/mongodb/mongo/commit/b5c8d777741147f5b9b7cfa89b5e69374d5c9d2d

Comment by auto [ 24/Oct/12 ]

Author:

{u'date': u'2012-10-24T10:58:30-07:00', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-7231 Removed log(level) functions
Branch: master
https://github.com/mongodb/mongo/commit/4db60cf23b58a7a5e177e69c142ab9e1503a3b1b

Comment by auto [ 24/Oct/12 ]

Author:

{u'date': u'2012-10-24T10:45:27-07:00', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-7231 Use LOG(level) macro instead of log(level) function
Branch: master
https://github.com/mongodb/mongo/commit/892aad0c2fd35985f12b052668f1e37195c17740

Comment by auto [ 24/Oct/12 ]

Author:

{u'date': u'2012-10-11T13:16:04-07:00', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}

Message: SERVER-7231 Use ternary operator in LOG() macro and add necessary comparison operators
Branch: master
https://github.com/mongodb/mongo/commit/0d61667c3870e9d0c9e04bd7475773ad3227e4e8

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