It's all about the answers!

Ask a question

How to retrieve Build Forge log information by step using Java API?


Bruno Costa (1122) | asked Jul 26 '12, 1:15 p.m.
 Hello,
I've been trying to retrieve BF log programmatically using Java API and I have difficult to filter the log information I want. I want to recover the log from a step, but I can't find a way to ignore log from previous step. This is my code:


                Project project = Project.findByName(clientConnection, projectName);
List<Build> list = Build.findByProjectUuid(clientConnection, project.getUuid());
Build build;
List<Result> results;
List<Log> logs;
String aux = "";
for (int i = 0; i < list.size(); i++) {
build = list.get(i);
if(build.getTag().contains(tagValue) ){
results = build.getResults();
for (Result result : results) {
logs = result.getLogs();
for (Log log : logs) {
aux = aux + log.getLineId() + " " + log.getType() + " " + log.getMessageText() + "\n";
}
}
}
}

I tried to use QueryFilter, but I was not able to filter just the information that I need. Does anybody have a solution or a tip?

Thanks in advance,
Bruno

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.