edm::LogError ("category") << a << b << ... << z; edm::LogWarning ("category") << a << b << ... << z; edm::LogInfo ("category") << a << b << ... << z; LogDebug ("category") << a << b << ... << z;Here are some guidelines for the use of the functions.
LogDebug
:
There will be no message formatting overhead if the
debugging messages are not enabled, the statement
will be able to be removed completely at compile time with the proper defines.
LogDebug("SegmentFinder") << "Matching segment" << i << "in tracking volume" << vol; LogDebug("SegmentFinder") << "Starting to find candidates from" << numhits << "hits";
edm::LogDebug
:
edm::LogInfo("AlgoReport") << "Saw" << x << " Events";
edm::LogWarning
:
edm::LogWarning("Convergence") << "Could not satisfy convergence criteria in" << iters << "iterations, continuing"; edm::LogWarning("TooMuchData") << "Found" << x << "candidates, using only the top 100;
edm::LogError
:
This is only to be used to report errors that result from
exceptions throws.
edm::LogError
if you throw an exception - the system will make this call for you when
the exception is caught. Put all
the information that you want reported into the exception.
edm::LogError
For errors and warnings, category name examples include:
DataNotFound TooLittleData TooMuchData ReadoutError TimeBudgetExceededBy convention, category names should be 20 characters or shorter.
A log message can be a member of more than one category using the syntax:
edm::LogWarning("TooLittleData|Tracking") << "...";Such "compound" categories can, of course, exceed 20 characters.
For Info and Debug, category names can include the function that is being performed. Be aware, however, that the module label will automatically be affixed to the message, so explicitly placing that into the category or as an item in the message is superfluous.