Skip to content

Commit 476ba43

Browse files
c-dilksbaltzell
authored andcommitted
doc: better notes
1 parent 5748d3c commit 476ba43

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

‎docs/dev_notes.md‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,32 @@
22

33
## Controlling Log Levels
44

5-
To control the log level of a class with a `Logger`, make a logging `.properties` file, and set the level of each of your classes for which you want to use a non-default level; use the property name `className.level`, for example:
5+
To control the log level of a class with a `Logger`, use properties. As CLI options, you may use, for example,
6+
```
7+
-Dorg.jlab.detector.helicity.HelicityGenerator.level=FINEST # sets HelicityGenerator level to FINEST
8+
-D.level=FINE # sets the level of all loggers to FINE
9+
```
10+
11+
Alternatively, make a logging `.properties` file, and set the level of each of your classes for which you want to use a non-default level; use the property name `className.level`, for example:
612
```
713
# my_levels.properties
814
org.jlab.detector.helicity.HelicityGenerator.level = FINEST
915
org.jlab.detector.calib.utils.RCDBProvider.level = FINER
1016
```
11-
You can also control the _global_ log level for all classes with `.level`, for example, to set
12-
it to `FINE`:
17+
or use `.level` for the global level:
1318
```
19+
# my_levels.properties
1420
.level = FINE
1521
```
1622
To use this `.properties` file, run with the `java` option
1723
```
1824
-Djava.util.logging.config.file=my_levels.properties
1925
```
20-
For example, if using `run-coatjava`,
26+
Then, here are some examples for using it with `recon-util`:
2127
```bash
22-
run-coatjava [CLASS_NAME] [CLASS_ARGS] -- -Djava.util.logging.config.file=my_levels.properties
28+
recon-util [ARGS] -- -Djava.util.logging.config.file=my_levels.properties # use your .properties file
29+
recon-util [ARGS] -- -D.level=ALL # set the global level to ALL (very verbose!)
30+
recon-util [ARGS] -- -D.level=OFF # silence the loggers
2331
```
2432
From high to low, the levels are `SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST` (see `java.util.logging.Level` documentation).
2533
You may also use levels `ALL` or `OFF`, for everything or nothing, respectively.

0 commit comments

Comments
 (0)