@@ -10,7 +10,7 @@ Helper class logger of progress operation.
1010It is intended for easy add possibility of logging progress of operations.
11111 . For example in Groovy way it so simple as:
1212
13- ```
13+ ``` groovy
1414ProgressLogger.each([1, 2, 3, 4, 5]){
1515 println it // Some long run operation
1616}
@@ -32,14 +32,14 @@ It will produce (by println) output like:
32322 . Ofter useful provide out method, for example to tie into current scope logger instead of global stdout, and add
3333some additional transform, it also simple:
3434
35- ```
35+ ``` groovy
3636ProgressLogger.each([1, 2, 3, 4, 5]){
3737 println it
3838}{ log.info "=$it=" }
3939```
4040
41413 . It may be used directly in plain old Java style like:
42- ```
42+ ``` groovy
4343ProgressLogger pl = new ProgressLogger(aisList, {log.info(it)});
4444for (Object aisObj in aisList){
4545 pl.next();
@@ -52,12 +52,12 @@ for (Object aisObj in aisList){
5252}
5353```
54545 . Or measure one run:
55- ```
55+ ``` groovy
5656ProgressLogger.measure({log.info(it)}, { /* long work * / }, 'Doing cool work')
5757```
58586 . When amount of elements or iterations is not known (f.e. stream processing or recursive calls like tree traversal)
5959totalAmountOfElements set to -1 and simpler statistic returned:
60- ```
60+ ``` groovy
6161def pl = new ProgressLogger()
6262[1, 2, 3, 4].each{
6363 sleep 1000;
@@ -79,22 +79,22 @@ Result will be something like:
7979Main goal to add functionality to ` ConfigObject ` GDK class.
8080
8181First it allow operations opposite flatten, set hierarchy from string, like:
82- ```
82+ ``` groovy
8383ConfigExtended conf = …
8484conf.setFromPropertyPathLikeKey('some.deep.hierarchy.of.properties', value)
8585```
8686and then access it as usual:
87- ```
87+ ``` groovy
8888conf.some.deep.hierarchy.of.properties
8989```
9090not as it is one string property.
91- ```
91+ ``` groovy
9292conf.'some.deep.hierarchy.of.properties'
9393```
9494
9595Additionally it override merge of ` ConfigObjects ` and do not replace completely replace Objects but set properties of it.
9696For example standard behaviour:
97- ```
97+ ``` groovy
9898// Uncomment next line if you are plan run example from GroovyConsole to handle defined there classes: http://groovy.329449.n5.nabble.com/GroovyConsole-and-context-thread-loader-td4471707.html
9999// Thread.currentThread().contextClassLoader = getClass().classLoader
100100@groovy.transform.ToString
@@ -115,4 +115,4 @@ assert config.test == 's change'
115115```
116116
117117But stop, why config.test replaced? Our intention was to set only their field s!
118- ** That class do that magic**
118+ ** That class do that magic**
0 commit comments