-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: Activity Infrastructure: Add trace log (#2568)
- Loading branch information
Showing
85 changed files
with
2,651 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
src/main/java/org/prebid/server/activity/infrastructure/ActivityCallResult.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/org/prebid/server/activity/infrastructure/debug/ActivityDebugUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.prebid.server.activity.infrastructure.debug; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.node.ArrayNode; | ||
import com.fasterxml.jackson.databind.node.TextNode; | ||
|
||
import java.util.List; | ||
|
||
public class ActivityDebugUtils { | ||
|
||
private ActivityDebugUtils() { | ||
} | ||
|
||
public static JsonNode asLogEntry(Object object, ObjectMapper mapper) { | ||
return object instanceof Loggable loggable | ||
? loggable.asLogEntry(mapper) | ||
: TextNode.valueOf(object.toString()); | ||
} | ||
|
||
public static ArrayNode asLogEntry(List<?> objects, ObjectMapper mapper) { | ||
final ArrayNode arrayNode = mapper.createArrayNode(); | ||
objects.stream() | ||
.map(object -> asLogEntry(object, mapper)) | ||
.forEach(arrayNode::add); | ||
|
||
return arrayNode; | ||
} | ||
} |
Oops, something went wrong.