projects
/
demos
/
kafka
/
chat
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: DRY for logging-category from io.projectreactor
[demos/kafka/chat]
/
src
/
main
/
java
/
de
/
juplo
/
kafka
/
chat
/
backend
/
storage
/
files
/
FilesStorageStrategy.java
diff --git
a/src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java
b/src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java
index
fd8939b
..
7c1fef0
100644
(file)
--- a/
src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java
+++ b/
src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java
@@
-33,6
+33,9
@@
public class FilesStorageStrategy implements StorageStrategy
private final Path storagePath;
private final ShardingStrategy shardingStrategy;
private final ObjectMapper mapper;
private final Path storagePath;
private final ShardingStrategy shardingStrategy;
private final ObjectMapper mapper;
+ private final String loggingCategory = FilesStorageStrategy.class.getSimpleName();
+ private final Level loggingLevel;
+ private final boolean showOperatorLine;
@Override
@Override
@@
-51,9
+54,9
@@
public class FilesStorageStrategy implements StorageStrategy
return chatRoomInfoFlux
.log(
return chatRoomInfoFlux
.log(
-
FilesStorageStrategy.class.getSimpleName()
,
-
Level.FINE
,
-
tru
e)
+
loggingCategory
,
+
loggingLevel
,
+
showOperatorLin
e)
.doFirst(() ->
{
try
.doFirst(() ->
{
try
@@
-105,9
+108,9
@@
public class FilesStorageStrategy implements StorageStrategy
return Flux
.from(new JsonFilePublisher<ChatRoomInfoTo>(chatroomsPath(), mapper, type))
.log(
return Flux
.from(new JsonFilePublisher<ChatRoomInfoTo>(chatroomsPath(), mapper, type))
.log(
-
FilesStorageStrategy.class.getSimpleName()
,
-
Level.FINE
,
-
tru
e)
+
loggingCategory
,
+
loggingLevel
,
+
showOperatorLin
e)
.map(chatRoomInfoTo ->
{
UUID chatRoomId = chatRoomInfoTo.getId();
.map(chatRoomInfoTo ->
{
UUID chatRoomId = chatRoomInfoTo.getId();
@@
-144,9
+147,9
@@
public class FilesStorageStrategy implements StorageStrategy
return messageFlux
.log(
return messageFlux
.log(
-
FilesStorageStrategy.class.getSimpleName()
,
-
Level.FINE
,
-
tru
e)
+
loggingCategory
,
+
loggingLevel
,
+
showOperatorLin
e)
.doFirst(() ->
{
try
.doFirst(() ->
{
try
@@
-198,9
+201,9
@@
public class FilesStorageStrategy implements StorageStrategy
return Flux
.from(new JsonFilePublisher<MessageTo>(chatroomPath(chatRoomId), mapper, type))
.log(
return Flux
.from(new JsonFilePublisher<MessageTo>(chatroomPath(chatRoomId), mapper, type))
.log(
-
FilesStorageStrategy.class.getSimpleName()
,
-
Level.FINE
,
-
tru
e)
+
loggingCategory
,
+
loggingLevel
,
+
showOperatorLin
e)
.map(MessageTo::toMessage);
}
.map(MessageTo::toMessage);
}