avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-avalon-logkit/src/java/org/apache/log/output/io/rotate RotateStrategyByTime.java
Date Thu, 21 Feb 2002 15:11:00 GMT
colus       02/02/21 07:11:00

  Modified:    src/java/org/apache/log/output/io/rotate
                        RotateStrategyByTime.java
  Log:
  Rotation check before writing.
  Fix javadocs.
  
  Revision  Changes    Path
  1.6       +9 -9      jakarta-avalon-logkit/src/java/org/apache/log/output/io/rotate/RotateStrategyByTime.java
  
  Index: RotateStrategyByTime.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-logkit/src/java/org/apache/log/output/io/rotate/RotateStrategyByTime.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RotateStrategyByTime.java	21 Aug 2001 04:49:57 -0000	1.5
  +++ RotateStrategyByTime.java	21 Feb 2002 15:11:00 -0000	1.6
  @@ -14,7 +14,7 @@
    *
    * @author <a href="mailto:bh22351@i-one.at">Bernhard Huber</a>
    */
  -public class RotateStrategyByTime 
  +public class RotateStrategyByTime
       implements RotateStrategy
   {
       ///time interval when rotation is triggered.
  @@ -30,17 +30,17 @@
        * Rotate logs by time.
        * By default do log rotation every 24 hours
        */
  -    public RotateStrategyByTime() 
  +    public RotateStrategyByTime()
       {
           this( 1000 * 60 * 60 * 24 );
       }
   
       /**
        *  Rotate logs by time.
  -     * 
  -     *  @param timeInterval rotate after time-interval [ms] has expired
  +     *
  +     *  @param timeInterval rotate before time-interval [ms] has expired
        */
  -    public RotateStrategyByTime( final long timeInterval ) 
  +    public RotateStrategyByTime( final long timeInterval )
       {
           m_startingTime = System.currentTimeMillis();
           m_currentRotation = 0;
  @@ -50,7 +50,7 @@
       /**
        * reset interval history counters.
        */
  -    public void reset() 
  +    public void reset()
       {
           m_startingTime = System.currentTimeMillis();
           m_currentRotation = 0;
  @@ -65,16 +65,16 @@
        * @param data the last message written to the log system
        * @return boolean return true if log rotation is neccessary, else false
        */
  -    public boolean isRotationNeeded( final String data, final File file ) 
  +    public boolean isRotationNeeded( final String data, final File file )
       {
  -        final long newRotation = 
  +        final long newRotation =
               (System.currentTimeMillis() - m_startingTime) / m_timeInterval;
   
           if( newRotation > m_currentRotation )
           {
               m_currentRotation = newRotation;
               return true;
  -        } 
  +        }
           else
           {
               return false;
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message