Skip to content

Commit 8f720a5

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 8d8d28e + 7ea09eb commit 8f720a5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Helper class logger of progress operation.
1010
It is intended for easy add possibility of logging progress of operations.
1111
1. For example in Groovy way it so simple as:
1212

13-
```
13+
```groovy
1414
ProgressLogger.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:
3232
2. Ofter useful provide out method, for example to tie into current scope logger instead of global stdout, and add
3333
some additional transform, it also simple:
3434

35-
```
35+
```groovy
3636
ProgressLogger.each([1, 2, 3, 4, 5]){
3737
println it
3838
}{ log.info "=$it=" }
3939
```
4040

4141
3. It may be used directly in plain old Java style like:
42-
```
42+
```groovy
4343
ProgressLogger pl = new ProgressLogger(aisList, {log.info(it)});
4444
for (Object aisObj in aisList){
4545
pl.next();
@@ -52,12 +52,12 @@ for (Object aisObj in aisList){
5252
}
5353
```
5454
5. Or measure one run:
55-
```
55+
```groovy
5656
ProgressLogger.measure({log.info(it)}, { /* long work * / }, 'Doing cool work')
5757
```
5858
6. When amount of elements or iterations is not known (f.e. stream processing or recursive calls like tree traversal)
5959
totalAmountOfElements set to -1 and simpler statistic returned:
60-
```
60+
```groovy
6161
def pl = new ProgressLogger()
6262
[1, 2, 3, 4].each{
6363
sleep 1000;
@@ -79,22 +79,22 @@ Result will be something like:
7979
Main goal to add functionality to `ConfigObject` GDK class.
8080

8181
First it allow operations opposite flatten, set hierarchy from string, like:
82-
```
82+
```groovy
8383
ConfigExtended conf = …
8484
conf.setFromPropertyPathLikeKey('some.deep.hierarchy.of.properties', value)
8585
```
8686
and then access it as usual:
87-
```
87+
```groovy
8888
conf.some.deep.hierarchy.of.properties
8989
```
9090
not as it is one string property.
91-
```
91+
```groovy
9292
conf.'some.deep.hierarchy.of.properties'
9393
```
9494

9595
Additionally it override merge of `ConfigObjects` and do not replace completely replace Objects but set properties of it.
9696
For 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

117117
But 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

Comments
 (0)