maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r191796 - in /maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log: ./ DefaultLog.java ScmLogDispatcher.java ScmLogger.java
Date Wed, 22 Jun 2005 10:47:54 GMT
Author: evenisse
Date: Wed Jun 22 03:47:53 2005
New Revision: 191796

URL: http://svn.apache.org/viewcvs?rev=191796&view=rev
Log:
Add missing files

Added:
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java 
 (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java
  (with props)
    maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java  
(with props)

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java?rev=191796&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java Wed
Jun 22 03:47:53 2005
@@ -0,0 +1,142 @@
+/**
+ * 
+ */
+package org.apache.maven.scm.log;
+
+/**
+ * @author Emmanuel Venisse
+ *
+ */
+public class DefaultLog
+    implements ScmLogger
+{
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isDebugEnabled()
+     */
+    public boolean isDebugEnabled()
+    {
+        return false;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.String)
+     */
+    public void debug( String content )
+    {
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.String, java.lang.Throwable)
+     */
+    public void debug( String content, Throwable error )
+    {
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.Throwable)
+     */
+    public void debug( Throwable error )
+    {
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isInfoEnabled()
+     */
+    public boolean isInfoEnabled()
+    {
+        return true;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.String)
+     */
+    public void info( String content )
+    {
+        System.out.println(content);
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.String, java.lang.Throwable)
+     */
+    public void info( String content, Throwable error )
+    {
+        System.out.println(content);
+        error.printStackTrace();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.Throwable)
+     */
+    public void info( Throwable error )
+    {
+        error.printStackTrace();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isWarnEnabled()
+     */
+    public boolean isWarnEnabled()
+    {
+        return true;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.String)
+     */
+    public void warn( String content )
+    {
+        System.out.println(content);
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.String, java.lang.Throwable)
+     */
+    public void warn( String content, Throwable error )
+    {
+        System.out.println(content);
+        error.printStackTrace();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.Throwable)
+     */
+    public void warn( Throwable error )
+    {
+        error.printStackTrace();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isErrorEnabled()
+     */
+    public boolean isErrorEnabled()
+    {
+        return true;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.String)
+     */
+    public void error( String content )
+    {
+        System.out.print("[ERROR] " + content);
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.String, java.lang.Throwable)
+     */
+    public void error( String content, Throwable error )
+    {
+        System.out.println( "[ERROR] " + content);
+        error.printStackTrace();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.Throwable)
+     */
+    public void error( Throwable error )
+    {
+        error.printStackTrace();
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/DefaultLog.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java?rev=191796&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java
(added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java
Wed Jun 22 03:47:53 2005
@@ -0,0 +1,265 @@
+package org.apache.maven.scm.log;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class ScmLogDispatcher
+    implements ScmLogger
+{
+    private List listeners = new ArrayList();
+
+    public void addListener( ScmLogger logger )
+    {
+        listeners.add( logger );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.String, java.lang.Throwable)
+     */
+    public void debug( String content, Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.debug( content, error );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.String)
+     */
+    public void debug( String content )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.debug( content );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.Throwable)
+     */
+    public void debug( Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.debug( error );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.String, java.lang.Throwable)
+     */
+    public void error( String content, Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.error( content, error );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.String)
+     */
+    public void error( String content )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.error( content );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.Throwable)
+     */
+    public void error( Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.error( error );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.String, java.lang.Throwable)
+     */
+    public void info( String content, Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.info( content, error );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.String)
+     */
+    public void info( String content )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.info( content );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.Throwable)
+     */
+    public void info( Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.info( error );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isDebugEnabled()
+     */
+    public boolean isDebugEnabled()
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            if ( logger.isDebugEnabled() )
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isErrorEnabled()
+     */
+    public boolean isErrorEnabled()
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            if ( logger.isErrorEnabled() )
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isInfoEnabled()
+     */
+    public boolean isInfoEnabled()
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            if ( logger.isInfoEnabled() )
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isWarnEnabled()
+     */
+    public boolean isWarnEnabled()
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            if ( logger.isWarnEnabled() )
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.String, java.lang.Throwable)
+     */
+    public void warn( String content, Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.warn( content, error );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.String)
+     */
+    public void warn( String content )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.warn( content );
+        }
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.Throwable)
+     */
+    public void warn( Throwable error )
+    {
+        for ( Iterator i = listeners.iterator(); i.hasNext(); )
+        {
+            ScmLogger logger = (ScmLogger) i.next();
+
+            logger.warn( error );
+        }
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogDispatcher.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java?rev=191796&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java (added)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java Wed
Jun 22 03:47:53 2005
@@ -0,0 +1,56 @@
+package org.apache.maven.scm.log;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface ScmLogger
+{
+    boolean isDebugEnabled();
+    
+    void debug( String content );
+
+    void debug( String content, Throwable error );
+
+    void debug( Throwable error );
+
+    boolean isInfoEnabled();
+    
+    void info( String content );
+
+    void info( String content, Throwable error );
+
+    void info( Throwable error );
+
+    boolean isWarnEnabled();
+    
+    void warn( String content );
+
+    void warn( String content, Throwable error );
+
+    void warn( Throwable error );
+
+    boolean isErrorEnabled();
+    
+    void error( String content );
+
+    void error( String content, Throwable error );
+
+    void error( Throwable error );
+}

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/log/ScmLogger.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message