some refactor
This commit is contained in:
parent
6eb83d2a07
commit
5739606f8b
1 changed files with 6 additions and 7 deletions
|
|
@ -19,13 +19,12 @@ public class LogFormatter {
|
||||||
static final ObjectMapper json;
|
static final ObjectMapper json;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
json = new ObjectMapper()
|
||||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true)
|
||||||
objectMapper.registerModule(new JavaTimeModule());
|
.registerModule(new JavaTimeModule())
|
||||||
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
|
||||||
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
|
.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE)
|
||||||
objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||||
json = objectMapper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String toString(Object o) {
|
public static String toString(Object o) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue