Skip to content

Commit 047da1b

Browse files
committed
Remove explicit loading of FWCore.MessageService.MessageLogger_cfi from Readme
1 parent 639c551 commit 047da1b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

FWCore/MessageService/Readme.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Useful MessageLogger Configuration Changes
22

3+
Note that `MessageLogger` is part of `process` by default, i.e. explicit loading of `FWCore.MessageService.MessageLogger_cfi` is not necessary.
4+
35
## Turning off the end of job statistics
46
This requires setting the parameter of cerr
57
```python
6-
process.load("FWCore.MessageService.MessageLogger_cfi")
78
process.MessageLogger.cerr.enableStatistics = False
89
```
910

1011
## Switching from cerr to cout
1112
One needs to switch off cerr and switch on cout
1213

1314
```python
14-
process.load("FWCore.MessageService.MessageLogger_cfi")
1515
process.MessageLogger.cerr.enable = False
1616
process.MessageLogger.cout.enable = True
1717
```
@@ -20,7 +20,6 @@ process.MessageLogger.cout.enable = True
2020
Assuming the file you want to write is name `my_file.log` then
2121

2222
```python
23-
process.load("FWCore.MessageService.MessageLogger_cfi")
2423
process.MessageLogger.files.my_file = dict()
2524
```
2625

@@ -34,14 +33,12 @@ process.MessageLogger.cerr.enable = False
3433
By default the `cerr` will reject all messages below `FWKINFO` (i.e. `threshold = "FWKINFO"`) and the defaut for `INFO` is set to print no output ,i.e. `limit = 0`. So to see all `INFO` messages one would do
3534

3635
```python
37-
process.load("FWCore.MessageService.MessageLogger_cfi")
3836
process.MessageLogger.cerr.threshold = "INFO"
3937
process.MessageLogger.cerr.INFO.limit = -1
4038
```
4139

4240
All messages above `FWKINFO` by default are set to be displayed, that is they have `limit = -1`. You can explicitly set that by doing
4341
```python
44-
process.load("FWCore.MessageService.MessageLogger_cfi")
4542
process.MessageLogger.cerr.WARNING = dict(limit = -1)
4643
```
4744

@@ -52,7 +49,6 @@ The `MessageLogger.cerr` PSet knows that all _extra_ parameter labels must be of
5249
By default the `cerr` will reject all messages below `FWKINFO` (i.e. `threshold = "FWKINFO"`) and the defaut for `INFO` is set to print no output ,i.e. `limit = 0`. In order to see messages for the category 'MyCat' the threshold must be lowered and the category must be explicitly mentioned
5350

5451
```python
55-
process.load("FWCore.MessageService.MessageLogger_cfi")
5652
process.MessageLogger.cerr.threshold = "INFO"
5753
process.MessageLogger.cerr.MyCat = dict()
5854
```
@@ -64,7 +60,6 @@ The `MessageLogger.cerr` PSet knows that all _extra_ parameter labels must be of
6460
In order to supporess messages for a given category, e.g. 'MyCat', the limit should be set to 0
6561

6662
```python
67-
process.load("FWCore.MessageService.MessageLogger_cfi")
6863
process.MessageLogger.MyCat = dict(limit = 0)
6964
```
7065

@@ -83,15 +78,13 @@ By default, all `LogDebug` code is actually removed at compilation time so any m
8378
Then in the `MessageLogger` configuration you need to lower the `threshold` to `"DEBUG"` and then say you want debug messages from the module. So if your module uses the label `myModule` in the configuration, you'd specify
8479

8580
```python
86-
process.load("FWCore.MessageService.MessageLogger_cfi")
8781
process.MessageLogger.cerr.threshold = "DEBUG"
8882
process.MessageLogger.debugModules = ["myModule"]
8983
```
9084

9185
If you are not interested in a particular module but instead want to see all debug messages, you can instead set `debugModules` using `*`
9286

9387
```python
94-
process.load("FWCore.MessageService.MessageLogger_cfi")
9588
process.MessageLogger.cerr.threshold = "DEBUG"
9689
process.MessageLogger.debugModules = ["*"]
9790
```

0 commit comments

Comments
 (0)