avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: avalon-logkit/src/java/org/apache/log/output/lf5 LogKitLogRecord.java LF5LogTarget.java
Date Mon, 07 Apr 2003 11:36:52 GMT
donaldp     2003/04/07 04:36:51

  Modified:    src/java/org/apache/log/output/lf5 LogKitLogRecord.java
                        LF5LogTarget.java
  Log:
  Whitespace.
  
  Revision  Changes    Path
  1.5       +42 -28    avalon-logkit/src/java/org/apache/log/output/lf5/LogKitLogRecord.java
  
  Index: LogKitLogRecord.java
  ===================================================================
  RCS file: /home/cvs/avalon-logkit/src/java/org/apache/log/output/lf5/LogKitLogRecord.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LogKitLogRecord.java	9 Feb 2003 23:33:24 -0000	1.4
  +++ LogKitLogRecord.java	7 Apr 2003 11:36:51 -0000	1.5
  @@ -54,15 +54,16 @@
    */
   package org.apache.log.output.lf5;
   
  -import org.apache.log.*;
  -import org.apache.log.format.Formatter;
  -import org.apache.log.util.StackIntrospector;
  -
   import java.util.Arrays;
   import java.util.List;
  -
  -import org.apache.log4j.lf5.LogRecord;
  +import org.apache.log.ContextMap;
  +import org.apache.log.LogEvent;
  +import org.apache.log.Logger;
  +import org.apache.log.Priority;
  +import org.apache.log.format.Formatter;
  +import org.apache.log.util.StackIntrospector;
   import org.apache.log4j.lf5.LogLevel;
  +import org.apache.log4j.lf5.LogRecord;
   
   /**
    * An implementation of a LogFactor5 <code>LogRecord</code> based on a
  @@ -72,7 +73,8 @@
    * @version CVS $Revision$ $Date$
    */
   
  -public class LogKitLogRecord extends LogRecord
  +public class LogKitLogRecord
  +    extends LogRecord
   {
       /** Is this a severe event ? */
       private boolean m_severe;
  @@ -87,49 +89,49 @@
           Object contextObject;
   
           // Category
  -        this.setCategory( event.getCategory() );
  +        setCategory( event.getCategory() );
   
           // Level
  -        this.setLevel( toLogLevel( event.getPriority() ) );
  +        setLevel( toLogLevel( event.getPriority() ) );
           m_severe = event.getPriority().isGreater( Priority.INFO );
   
           // Location
  -        if ( null != contextMap && null != ( contextObject = contextMap.get( "method"
) ) )
  +        if( null != contextMap && null != ( contextObject = contextMap.get( "method"
) ) )
           {
  -            this.setLocation( contextObject.toString() );
  +            setLocation( contextObject.toString() );
           }
           else
           {
  -            this.setLocation( StackIntrospector.getCallerMethod( Logger.class ) );
  +            setLocation( StackIntrospector.getCallerMethod( Logger.class ) );
           }
   
           // Message
  -        this.setMessage( event.getMessage() );
  +        setMessage( event.getMessage() );
   
           // Millis
  -        this.setMillis( event.getTime() );
  +        setMillis( event.getTime() );
   
           // NDC
  -        this.setNDC( fmt.format(event) );
  +        setNDC( fmt.format( event ) );
   
           // SequenceNumber
  -        //this.setSequenceNumber( 0L );
  +        //setSequenceNumber( 0L );
   
           // ThreadDescription
           if( null != contextMap && null != ( contextObject = contextMap.get( "thread"
) ) )
           {
  -            this.setThreadDescription( contextObject.toString() );
  +            setThreadDescription( contextObject.toString() );
           }
           else
           {
  -            this.setThreadDescription( Thread.currentThread().getName() );
  +            setThreadDescription( Thread.currentThread().getName() );
           }
   
           // Thrown
  -        this.setThrown( event.getThrowable() );
  +        setThrown( event.getThrowable() );
   
           // ThrownStackTrace
  -        //this.setThrownStackTrace("");
  +        //setThrownStackTrace("");
       }
   
       public boolean isSevereLevel()
  @@ -142,25 +144,37 @@
        */
       public LogLevel toLogLevel( final Priority priority )
       {
  -        if ( Priority.DEBUG == priority )
  +        if( Priority.DEBUG == priority )
  +        {
               return LogLevel.DEBUG;
  -        else if ( Priority.INFO == priority )
  +        }
  +        else if( Priority.INFO == priority )
  +        {
               return LogLevel.INFO;
  -        else if ( Priority.WARN == priority )
  +        }
  +        else if( Priority.WARN == priority )
  +        {
               return LogLevel.WARN;
  -        else if ( Priority.ERROR == priority )
  +        }
  +        else if( Priority.ERROR == priority )
  +        {
               return LogLevel.ERROR;
  -        else if ( Priority.FATAL_ERROR == priority )
  +        }
  +        else if( Priority.FATAL_ERROR == priority )
  +        {
               return LogLevel.FATAL;
  +        }
           else
  +        {
               return new LogLevel( priority.getName(), priority.getValue() );
  +        }
       }
   
       /**
        * The <code>LogLevel</code>s corresponding to LogKit priorities.
        */
       public static final List LOGKIT_LOGLEVELS =
  -        Arrays.asList(new LogLevel[] {
  +        Arrays.asList( new LogLevel[]{
               LogLevel.FATAL, LogLevel.ERROR, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG
  -        });
  +        } );
   }
  
  
  
  1.6       +10 -9     avalon-logkit/src/java/org/apache/log/output/lf5/LF5LogTarget.java
  
  Index: LF5LogTarget.java
  ===================================================================
  RCS file: /home/cvs/avalon-logkit/src/java/org/apache/log/output/lf5/LF5LogTarget.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LF5LogTarget.java	9 Feb 2003 23:33:24 -0000	1.5
  +++ LF5LogTarget.java	7 Apr 2003 11:36:51 -0000	1.6
  @@ -54,11 +54,10 @@
    */
   package org.apache.log.output.lf5;
   
  +import org.apache.log.LogEvent;
  +import org.apache.log.LogTarget;
   import org.apache.log.format.Formatter;
   import org.apache.log.format.PatternFormatter;
  -import org.apache.log.LogTarget;
  -import org.apache.log.LogEvent;
  -
   import org.apache.log4j.lf5.viewer.LogBrokerMonitor;
   
   /**
  @@ -75,13 +74,13 @@
       private static LogBrokerMonitor c_defaultLogMonitor;
   
       /** Default context map formatter */
  -    private static Formatter        c_defaultContextFormatter = new PatternFormatter("");
  +    private static Formatter c_defaultContextFormatter = new PatternFormatter( "" );
   
       /** Monitor for this LogTarget */
  -    private LogBrokerMonitor        m_monitor;
  +    private LogBrokerMonitor m_monitor;
   
       /** Format for context maps */
  -    private Formatter               m_contextFormatter = c_defaultContextFormatter;
  +    private Formatter m_contextFormatter = c_defaultContextFormatter;
   
       /**
        * Create a <code>LogFactorLogTarget</code> on a given <code>LogBrokerMonitor</code>.
  @@ -106,13 +105,14 @@
        * context) text on the GUI.
        * @param formatter the message formatter
        */
  -    public void setNDCFormatter( Formatter formatter )
  +    public void setNDCFormatter( final Formatter formatter )
       {
           m_contextFormatter = formatter;
       }
   
       /**
        * Get the default <code>LogBrokerMonitor</code> instance.
  +     *
        * @return the monitor
        */
       public static synchronized LogBrokerMonitor getDefaultMonitor()
  @@ -129,11 +129,12 @@
   
       /**
        * Process a log event.
  +     *
        * @param event the log event
        */
       public void processEvent( final LogEvent event )
       {
  -        if ( null == m_monitor )
  +        if( null == m_monitor )
           {
               m_monitor = getDefaultMonitor();
           }
  
  
  

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


Mime
View raw message