Skip to content

Commit

Permalink
Merge pull request #5306 from rdebusscher/FISH-1296
Browse files Browse the repository at this point in the history
FISH-1296: Show Logger levels in Web Console alphabetical.
  • Loading branch information
Rudy De Busscher authored Jun 18, 2021
2 parents f782d06 + 6a6c4a1 commit 1048a7d
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@
import org.glassfish.admingui.common.util.GuiUtil;
import org.glassfish.admingui.common.util.RestUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.logging.Level;

/**
Expand All @@ -83,14 +80,16 @@ public LoggingHandlers() {
public static void getLoggerLevels(HandlerContext handlerCtx) {

Map<String, String> loggerLevels = (Map) handlerCtx.getInputValue("loggerLevels");
List result = new ArrayList();
List<Map<String, Object>> result = new ArrayList<>();
if (loggerLevels != null) {
for(Map.Entry<String,String> e : loggerLevels.entrySet()){
Map oneRow = new HashMap();
oneRow.put("loggerName", e.getKey());
oneRow.put("level", e.getValue());
oneRow.put("selected", false);
result.add(oneRow);
List<String> keys = new ArrayList<>(loggerLevels.keySet());
Collections.sort(keys);
for (String key : keys) {
Map<String, Object> oneRow = new HashMap<>();
oneRow.put("loggerName", key);
oneRow.put("level", loggerLevels.get(key));
oneRow.put("selected", false);
result.add(oneRow);
}
}
handlerCtx.setOutputValue("loggerList", result);
Expand Down

0 comments on commit 1048a7d

Please sign in to comment.