psmith      2003/06/24 16:19:16

  Modified:    src/java/org/apache/log4j/chainsaw LogUI.java
  Log:
  When warned about 75%, and 100% change, probably only need
  to be warned once...
  
  Revision  Changes    Path
  1.115     +6 -3      
jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- LogUI.java        24 Jun 2003 22:35:30 -0000      1.114
  +++ LogUI.java        24 Jun 2003 23:19:16 -0000      1.115
  @@ -1760,21 +1760,24 @@
           tableModel.addEventCountListener(
             new EventCountListener() {
               final NumberFormat formatter = NumberFormat.getPercentInstance();
  -
  +            boolean warning75 = false;
  +            boolean warning100 = false;
               public void eventCountChanged(int currentCount, int totalCount) {
                 double percent =
                   ((double) totalCount) / cyclicModel.getMaxSize();
                 String msg = null;
   
  -              if ((percent > 0.75) && (percent < 1.0)) {
  +              if ((percent > 0.75) && (percent < 1.0) && !warning75) {
                   msg =
                     "Warning :: " + formatter.format(percent) + " of the '"
                     + getIdentifier() + "' buffer has been used";
  -              } else if (percent >= 1.0) {
  +                  warning75 = true;
  +              } else if (percent >= 1.0 && !warning100) {
                   msg =
                     "Warning :: " + formatter.format(percent) + " of the '"
                     + getIdentifier()
                     + "' buffer has been used.  Older events are being discarded.";
  +                  warning100 = true;
                 }
   
                 if (msg != null) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to