Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageLogger no longer prints summary by default #38805

Merged
merged 1 commit into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ got data of type "edmtest::Doodad" with name "abcd" in record GadgetRcd
++++++++ finished: processing esmodule: label = '' type = DoodadESSource in record = GadgetRcd
got data of type "edmtest::Doodad" with name "abc" in record GadgetRcd
got data of type "edmtest::Doodad" with name "abc" in record GadgetRcd
25 Tracer -s DoodadESSource:D 4 4
9 changes: 9 additions & 0 deletions FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,15 @@ namespace edm {
if (m_statisticsResets[i])
m_statisticsDestControls[i]->wipe();
}
auto dropped = m_tooManyWaitingMessagesCount.load();
if (m_statisticsDestControls.empty() and dropped != 0) {
if (m_stream_ps.find("cerr") != m_stream_ps.end()) {
std::cerr << "MessageLogger: dropped waiting message count " << dropped << "\n";
}
if (m_stream_ps.find("cout") != m_stream_ps.end()) {
std::cout << "MessageLogger: dropped waiting message count " << dropped << "\n";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if m_stream_ps contains both cerr and cout? Would it still be appropriate to print the message in both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that would be the case (and I don't think I've found a case where that is actually done) maybe they are redirecting output to two different files than both messages could still be useful. But I'm not wedded to the idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@makortel Do you want to have this changed to only output to cerr if both cerr and cout are active or keep it as it is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it as it is.

}
}

void ThreadSafeLogMessageLoggerScribe::triggerFJRmessageSummary(std::map<std::string, double>& sm) // ChangeLog 29
Expand Down
1 change: 1 addition & 0 deletions FWCore/MessageService/test/u20_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
noTimeStamps = cms.untracked.bool(True)
)
process.MessageLogger.cerr.noTimeStamps = True
process.MessageLogger.cerr.enableStatistics = True

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
Expand Down
2 changes: 1 addition & 1 deletion FWCore/ParameterSet/python/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2397,7 +2397,7 @@ def testProcessDumpPython(self):
limit = cms.untracked.int32(10000000)
),
enable = cms.untracked.bool(True),
enableStatistics = cms.untracked.bool(True),
enableStatistics = cms.untracked.bool(False),
lineLength = cms.optional.untracked.int32,
noLineBreaks = cms.optional.untracked.bool,
noTimeStamps = cms.untracked.bool(False),
Expand Down
2 changes: 1 addition & 1 deletion FWCore/ParameterSet/python/MessageLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
default = _default_pset.clone(),
cerr = _destination_base.clone(
enable = untracked.bool(True),
enableStatistics = untracked.bool(True),
enableStatistics = untracked.bool(False),
resetStatistics = untracked.bool(False),
statisticsThreshold = untracked.string('WARNING'),
INFO = untracked.PSet(
Expand Down