Skip to content

Commit eaa2d63

Browse files
authored
Intro trace in Logging.md
1 parent 28cd3ff commit eaa2d63

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

src/developing/Logging.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,17 @@ ldmx_log(info) << My message goes here;
5353
```
5454
`info` is the severity level of this message. A severity level can be any of the following:
5555
56-
Level | Int | Description | Example
57-
--- | --- | --- | ---
58-
`debug` | 0 | Extra-detailed information that you would want if you were suspicious that things were running correctly | Whether a sensitive detector is skipping a hit or not
59-
`info` | 1 | Helpful comments for checking operations, average one message per event per channel | What processes are enabled in Geant4, event-level information like the number of hits
60-
`warn` | 2 | Something wrong happened but its not too bad | REGEX mismatch in GDML parsing
61-
`error`| 3 | Something _really_ wrong happened and the user needs to know that something needs to change | Extra information before an `EXCEPTION_RAISE` calls
62-
`fatal`| 4 | Reserved for run-ending exceptions | Message from catches of `Exception`.
56+
Level | Int | Description | Example | Printout frequency
57+
--- | --- | --- | --- | ---
58+
`trace` | -1 | Printouts for cases that are more verbose than what you would put for `debug | SimHit level information, or processes that are skipped in the end, or printouts that only help to see that the code got to line xyz, but are not very helpful for the end user | Several dozens
59+
`debug` | 0 | Extra-detailed information that you would want if you were suspicious that things were running correctly | Whether a sensitive detector is skipping a hit or not | Few O(10) / event
60+
`info` | 1 | Helpful comments for checking operations, average one message per event per channel | What processes are enabled in Geant4, event-level information like the number of hits | O(1) / event
61+
`warn` | 2 | Something wrong happened but its not too bad | REGEX mismatch in GDML parsing | O(10) / run
62+
`error`| 3 | Something _really_ wrong happened and the user needs to know that something needs to change | Extra information before an `EXCEPTION_RAISE` calls | O(1) / run
63+
`fatal`| 4 | Reserved for run-ending exceptions | Message from catches of `Exception` | 1 / run
6364
6465
This is really all you need for an `EventProcessor`. Notice that the logger _does not_ need a new line character at the end of the line. The logger automatically makes a new line after each message.
6566
66-
There is an additional logging level below "debug". A lot of times during development, a developer puts messages inside of the code to make sure it is working properly. A lot of these extra messages are not very helpful for the end user, so they should not go into the log at all. Feel free to leave these messages in, but comment them out so that they don't clog up the log. A good rule of thumb is that the debug channel can have a few messages per event, info - at most one message every event, warn - a few messages total per run, and error only one message per run.
67-
6867
## More Detail: Logging Outside Processors
6968
7069
There are some other inheritance trees inside of ldmx-sw that have `theLog_` as a protected member variable (like how it is set up for processors). For example, `XsecBiasingOperator`, `UserAction`, and `PrimaryGenerator`, so you _may not_ need to define a new member `theLog_` in your class if it inherits from a class with `theLog_` already defined and accessible (i.e. public or protected).

0 commit comments

Comments
 (0)