Skip to content

Commit b435832

Browse files
committed
Update changelog
1 parent 640b9eb commit b435832

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 4.0.0
4+
5+
* Change package from `com.tersesystems.echopraxia` to `echopraxia`.
6+
* Move logging specific API (Conditions, LoggingContext) to `echopraxia.logging.api` so that only fields, values, attributes are core `echopraxia.api`. * Break out JSONPath dependency (requires SLF4J 2.x, awkward for Log4J2 and JUL frameworks)
7+
* Add `JSONPathCondition.pathCondition` so that JSON path functionality is still available.
8+
* Add a `simple` logger that does not use field builder functions or conditions.
9+
* Remove `async`, `fluent`, and `semantic` modules from codebase (they are best done at user level)
10+
* Remove `asyncLog` methods from core loggers (this is better done at a user level).
11+
* Update logstash encoder dependency to 8.0, logback dependency to 1.5.x (requires SLF4J 2.x)
12+
* Add dependency on jsonpath for `scripting` module.
13+
* Remove deprecated methods on field attributes.
14+
315
## 3.2.1
416

517
* Fix a bug where `toStringValue` was not correctly applied to `Value.object` or `Value.array`.

docs/usage/conditions.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ This is only a part of the available functionality in conditions. You can tie c
6363

6464
## JSON Path
6565

66-
If you are using the Logstash implementation, you can use the `echopraxia.jsonpath.JsonPathCondition.pathCondition()` method to provide you with an extended context that has logging methods:
66+
If you are using the Logstash implementation or have explicitly added the `jsonpath` module, you can use the `echopraxia.jsonpath.JsonPathCondition.pathCondition()` method to provide you with an extended context that has logging methods:
6767

6868
This will give you a context that extends `FindPathMethods` that will let you use [JSONPath](https://github.com/json-path/JsonPath#jayway-jsonpath) to find values from the logging context in a condition.
6969

7070
```java
71+
import static echopraxia.jsonpath.JsonPathCondition.*;
72+
7173
Condition fooCondition = pathCondition((level, ctx) ->
7274
ctx.findString("$.foo").filter(s -> s.equals("bar")).isPresent()
7375
);
@@ -127,20 +129,22 @@ List<String> interests = context.findList("$.person.mother.interests");
127129
You can use [inline predicates](https://github.com/json-path/JsonPath#inline-predicates), which will return a `List` of the results:
128130

129131
```java
130-
final Condition cheapBookCondition =
131-
(level, context) -> ! context.findList("$.store.book[?(@.price < 10)]").isEmpty();
132+
final Condition cheapBookCondition = pathCondition(
133+
(level, context) -> ! context.findList("$.store.book[?(@.price < 10)]").isEmpty());
132134
```
133135

134136
The inline and filter predicates are not available for exceptions. Instead, you must use `filter`:
135137

136138
```java
139+
import static echopraxia.jsonpath.JsonPathCondition.*;
140+
137141
class FindException {
138142
void logException() {
139-
Condition throwableCondition = json
143+
Condition throwableCondition = pathCondition(
140144
(level, ctx) ->
141145
ctx.findThrowable()
142146
.filter(e -> "test message".equals(e.getMessage()))
143-
.isPresent();
147+
.isPresent());
144148

145149
logger.error(throwableCondition, "Error message", new RuntimeException("test message"));
146150
}

0 commit comments

Comments
 (0)