Skip to content

Commit

Permalink
1.7 Add BEventFactory.getSyntheticLog
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-yves-monnet committed Oct 31, 2019
1 parent 053e12d commit 5850eac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.bonitasoft.log.event</groupId>
<artifactId>bonita-event</artifactId>
<version>1.6.0</version>
<version>1.7.0</version>
<name>BonitaEvent</name>
</project>
2 changes: 1 addition & 1 deletion src/main/java/org/bonitasoft/log/event/BEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public String getParameters() {
}

public String getExceptionDetails() {
return mExceptionDetails;
return mExceptionDetails==null ? "" : mExceptionDetails;
}

private String stringToJson(final String source) {
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/bonitasoft/log/event/BEventFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ public static String getSyntheticHtml(final List<BEvent> listEvents) {
tableHtml.append( "</table>");
return tableHtml.toString();
}

/**
* return a list of event for a log
* @param listEvents
* @return
*/
public static String getSyntheticLog(final List<BEvent> listEvents) {
StringBuffer tableLog= new StringBuffer();


for (final BEvent event : listEvents) {
tableLog.append( event.toString()+" <~> ");
}

return tableLog.toString();
}
/**
* add the event in the list only if this event is a new one, in order to remove the duplication.
* An event already exist if this is the same package/number/parameters (see BEvent.same() ).
Expand Down

0 comments on commit 5850eac

Please sign in to comment.