MessageManager.getString("label.log_level") + ":");
// logLevelCombo.addItem(Level.ALL);
+ logLevelCombo.addItem(Level.TRACE);
logLevelCombo.addItem(Level.DEBUG);
logLevelCombo.addItem(Level.INFO);
logLevelCombo.addItem(Level.WARN);
// logLevelCombo.addItem(Level.ERROR);
// logLevelCombo.addItem(Level.FATAL);
// logLevelCombo.addItem(Level.OFF);
- // logLevelCombo.addItem(Level.TRACE);
setChosenLogLevelCombo();
logLevelCombo.addActionListener(new ActionListener()
{
Level currentLogLevel = Cache.log == null ? Level.INFO
: Cache.log.getLevel();
logLevelCombo.setSelectedItem(currentLogLevel);
- if (!logLevelCombo.getSelectedItem().equals(currentLogLevel))
+ if (!logLevelCombo.getSelectedItem().equals(currentLogLevel)) // currentLogLevel
+ // not in list
{
- logLevelCombo.setSelectedItem(Level.INFO);
+ if (currentLogLevel != null && currentLogLevel instanceof Level)
+ {
+ // add new item to list (might be set via .jalview_properties)
+ boolean added = false;
+ for (int i = 0; i < logLevelCombo.getItemCount(); i++)
+ {
+ Level l = (Level) logLevelCombo.getItemAt(i);
+ if (l.isGreaterOrEqual(currentLogLevel))
+ {
+ logLevelCombo.insertItemAt(currentLogLevel, i);
+ added = true;
+ break;
+ }
+ }
+ if (!added) // lower priority than others or some confusion -- add to
+ // end of list
+ {
+ logLevelCombo.addItem(currentLogLevel);
+ }
+ logLevelCombo.setSelectedItem(currentLogLevel);
+ }
+ else
+ {
+ logLevelCombo.setSelectedItem(Level.INFO);
+ }
}
}
cb.setContents(consoleTextSelection, null);
}
- private void setLogLevel()
- {
-
- }
-
PipedOutputStream pout = null, perr = null;
public void redirectStreams()