Index: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java
===================================================================
--- doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java	(revision 0)
+++ doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java	(revision 0)
@@ -0,0 +1,184 @@
+package org.apache.maven.doxia.logging;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * This interface supplies the API for providing feedback to the user from
+ * a Parser or Sink, using standard <code>Doxia</code> channels.
+ * <br/>
+ * There should be no big surprises here, although you may notice that the methods accept
+ * <code>java.lang.CharSequence</code> rather than <code>java.lang.String</code>. This is provided mainly as a
+ * convenience, to enable developers to pass things like <code>java.lang.StringBuffer</code> directly into the logger,
+ * rather than formatting first by calling <code>toString()</code>.
+ *
+ * @author jdcasey
+ * @author ltheussl
+ * @version $Id$
+ * @since 1.0-beta-1
+ */
+public interface Log
+{
+
+    /** DEBUG level, intitialized to a value 300. */
+    int DEBUG = 300;
+
+    /** INFO level, intitialized to a value 400. */
+    int INFO = 400;
+
+    /** WARN level, intitialized to a value 500. */
+    int WARN = 500;
+
+    /** ERROR level, intitialized to a value 600. */
+    int ERROR = 600;
+
+    /** OFF level, intitialized to a value 1000. */
+    int OFF = 1000;
+
+    /**
+     * Set the current log level.
+     *
+     * @param level the log level to set.
+     */
+    void setLogLevel( int level );
+
+    /**
+     * @return true if the <b>debug</b> error level is enabled
+     */
+    boolean isDebugEnabled();
+
+    /**
+     * Send a message to the user in the <b>debug</b> error level.
+     *
+     * @param content
+     */
+    void debug( CharSequence content );
+
+    /**
+     * Send a message (and accompanying exception) to the user in the <b>debug</b> error level.
+     * <br/>
+     * The error's stacktrace will be output when this error level is enabled.
+     *
+     * @param content
+     * @param error
+     */
+    void debug( CharSequence content, Throwable error );
+
+    /**
+     * Send an exception to the user in the <b>debug</b> error level.
+     * <br/>
+     * The stack trace for this exception will be output when this error level is enabled.
+     *
+     * @param error
+     */
+    void debug( Throwable error );
+
+    /**
+     * @return true if the <b>info</b> error level is enabled
+     */
+    boolean isInfoEnabled();
+
+    /**
+     * Send a message to the user in the <b>info</b> error level.
+     *
+     * @param content
+     */
+    void info( CharSequence content );
+
+    /**
+     * Send a message (and accompanying exception) to the user in the <b>info</b> error level.
+     * <br/>
+     * The error's stacktrace will be output when this error level is enabled.
+     *
+     * @param content
+     * @param error
+     */
+    void info( CharSequence content, Throwable error );
+
+    /**
+     * Send an exception to the user in the <b>info</b> error level.
+     * <br/>
+     * The stack trace for this exception will be output when this error level is enabled.
+     *
+     * @param error
+     */
+    void info( Throwable error );
+
+    /**
+     * @return true if the <b>warn</b> error level is enabled
+     */
+    boolean isWarnEnabled();
+
+    /**
+     * Send a message to the user in the <b>warn</b> error level.
+     *
+     * @param content
+     */
+    void warn( CharSequence content );
+
+    /**
+     * Send a message (and accompanying exception) to the user in the <b>warn</b> error level.
+     * <br/>
+     * The error's stacktrace will be output when this error level is enabled.
+     *
+     * @param content
+     * @param error
+     */
+    void warn( CharSequence content, Throwable error );
+
+    /**
+     * Send an exception to the user in the <b>warn</b> error level.
+     * <br/>
+     * The stack trace for this exception will be output when this error level is enabled.
+     *
+     * @param error
+     */
+    void warn( Throwable error );
+
+    /**
+     * @return true if the <b>error</b> error level is enabled
+     */
+    boolean isErrorEnabled();
+
+    /**
+     * Send a message to the user in the <b>error</b> error level.
+     *
+     * @param content
+     */
+    void error( CharSequence content );
+
+    /**
+     * Send a message (and accompanying exception) to the user in the <b>error</b> error level.
+     * <br/>
+     * The error's stacktrace will be output when this error level is enabled.
+     *
+     * @param content
+     * @param error
+     */
+    void error( CharSequence content, Throwable error );
+
+    /**
+     * Send an exception to the user in the <b>error</b> error level.
+     * <br/>
+     * The stack trace for this exception will be output when this error level is enabled.
+     *
+     * @param error
+     */
+    void error( Throwable error );
+}
\ No newline at end of file

Property changes on: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/Log.java
___________________________________________________________________
Name: svn:keywords
   + "Author Date Id Revision"
Name: svn:eol-style
   + native

Index: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/SystemStreamLog.java
===================================================================
--- doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/SystemStreamLog.java	(revision 0)
+++ doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/SystemStreamLog.java	(revision 0)
@@ -0,0 +1,237 @@
+package org.apache.maven.doxia.logging;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+/**
+ * Logger with "standard" output and error output stream.
+ *
+ * @author jdcasey
+ * @author ltheussl
+ * @version $Id$
+ * @since 1.0-beta-1
+ */
+public class SystemStreamLog
+    implements Log
+{
+    private static final String EOL = System.getProperty( "line.separator" );
+
+    private int currentLevel = INFO;
+
+    /** {@inheritDoc} */
+    public void setLogLevel( int level )
+    {
+        if ( level <= DEBUG )
+        {
+            currentLevel = DEBUG;
+        }
+        else if ( level <= INFO )
+        {
+            currentLevel = INFO;
+        }
+        else if ( level <= WARN )
+        {
+            currentLevel = WARN;
+        }
+        else if ( level <= ERROR )
+        {
+            currentLevel = ERROR;
+        }
+        else
+        {
+            currentLevel = OFF;
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void debug( CharSequence content )
+    {
+        if ( isDebugEnabled() )
+        {
+            print( "debug", content );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void debug( CharSequence content, Throwable error )
+    {
+        if ( isDebugEnabled() )
+        {
+            print( "debug", content, error );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void debug( Throwable error )
+    {
+        if ( isDebugEnabled() )
+        {
+            print( "debug", error );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void info( CharSequence content )
+    {
+        if ( isInfoEnabled() )
+        {
+            print( "info", content );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void info( CharSequence content, Throwable error )
+    {
+        if ( isInfoEnabled() )
+        {
+            print( "info", content, error );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void info( Throwable error )
+    {
+        if ( isInfoEnabled() )
+        {
+            print( "info", error );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void warn( CharSequence content )
+    {
+        if ( isWarnEnabled() )
+        {
+            print( "warn", content );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void warn( CharSequence content, Throwable error )
+    {
+        if ( isWarnEnabled() )
+        {
+            print( "warn", content, error );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void warn( Throwable error )
+    {
+        if ( isWarnEnabled() )
+        {
+            print( "warn", error );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void error( CharSequence content )
+    {
+        if ( isErrorEnabled() )
+        {
+            System.err.println( "[error] " + content.toString() );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void error( CharSequence content, Throwable error )
+    {
+        if ( isErrorEnabled() )
+        {
+            StringWriter sWriter = new StringWriter();
+            PrintWriter pWriter = new PrintWriter( sWriter );
+
+            error.printStackTrace( pWriter );
+
+            System.err.println( "[error] " + content.toString()
+                + EOL + EOL + sWriter.toString() );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void error( Throwable error )
+    {
+        if ( isErrorEnabled() )
+        {
+            StringWriter sWriter = new StringWriter();
+            PrintWriter pWriter = new PrintWriter( sWriter );
+
+            error.printStackTrace( pWriter );
+
+            System.err.println( "[error] " + sWriter.toString() );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public boolean isDebugEnabled()
+    {
+        return ( currentLevel <= DEBUG );
+    }
+
+    /** {@inheritDoc} */
+    public boolean isInfoEnabled()
+    {
+        return ( currentLevel <= INFO );
+    }
+
+    /** {@inheritDoc} */
+    public boolean isWarnEnabled()
+    {
+        return ( currentLevel <= WARN );
+    }
+
+    /** {@inheritDoc} */
+    public boolean isErrorEnabled()
+    {
+        return ( currentLevel <= ERROR );
+    }
+
+      //
+     // private
+    //
+
+    private void print( String prefix, CharSequence content )
+    {
+        System.out.println( "[" + prefix + "] " + content.toString() );
+    }
+
+    private void print( String prefix, Throwable error )
+    {
+        StringWriter sWriter = new StringWriter();
+        PrintWriter pWriter = new PrintWriter( sWriter );
+
+        error.printStackTrace( pWriter );
+
+        System.out.println( "[" + prefix + "] " + sWriter.toString() );
+    }
+
+    private void print( String prefix, CharSequence content, Throwable error )
+    {
+        StringWriter sWriter = new StringWriter();
+        PrintWriter pWriter = new PrintWriter( sWriter );
+
+        error.printStackTrace( pWriter );
+
+        System.out.println( "[" + prefix + "] " + content.toString()
+            + EOL + EOL + sWriter.toString() );
+    }
+}
\ No newline at end of file

Property changes on: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/SystemStreamLog.java
___________________________________________________________________
Name: svn:keywords
   + "Author Date Id Revision"
Name: svn:eol-style
   + native

Index: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/DefaultLog.java
===================================================================
--- doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/DefaultLog.java	(revision 0)
+++ doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/DefaultLog.java	(revision 0)
@@ -0,0 +1,180 @@
+package org.apache.maven.doxia.logging;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.doxia.logging.Log;
+
+import org.codehaus.plexus.logging.Logger;
+
+/**
+ * Wrap a Plexus logger into a Doxia logger.
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id:$
+ * @since 1.0-beta-1
+ */
+public class DefaultLog
+    implements Log
+{
+    private final Logger logger;
+ 
+    /**
+     * @param logger
+     */
+    public DefaultLog( Logger logger )
+    {
+        this.logger = logger;
+    }
+
+    /** {@inheritDoc} */
+    public void setLogLevel( int level )
+    {
+        if ( level <= DEBUG )
+        {
+            logger.setThreshold( Logger.LEVEL_DEBUG );
+        }
+        else if ( level <= INFO )
+        {
+            logger.setThreshold( Logger.LEVEL_INFO );
+        }
+        else if ( level <= WARN )
+        {
+            logger.setThreshold( Logger.LEVEL_WARN );
+        }
+        else if ( level <= ERROR )
+        {
+            logger.setThreshold( Logger.LEVEL_ERROR );
+        }
+        else
+        {
+            logger.setThreshold( Logger.LEVEL_DISABLED );
+        }
+    }
+
+    /** {@inheritDoc} */
+    public void debug( CharSequence content )
+    {
+        logger.debug( toString( content ) );
+    }
+
+    /** {@inheritDoc} */
+    public void debug( CharSequence content, Throwable error )
+    {
+        logger.debug( toString( content ), error );
+    }
+
+    /** {@inheritDoc} */
+    public void debug( Throwable error )
+    {
+        logger.debug( "", error );
+    }
+
+    /** {@inheritDoc} */
+    public void info( CharSequence content )
+    {
+        logger.info( toString( content ) );
+    }
+
+    /** {@inheritDoc} */
+    public void info( CharSequence content, Throwable error )
+    {
+        logger.info( toString( content ), error );
+    }
+
+    /** {@inheritDoc} */
+    public void info( Throwable error )
+    {
+        logger.info( "", error );
+    }
+
+    /** {@inheritDoc} */
+    public void warn( CharSequence content )
+    {
+        logger.warn( toString( content ) );
+    }
+
+    /** {@inheritDoc} */
+    public void warn( CharSequence content, Throwable error )
+    {
+        logger.warn( toString( content ), error );
+    }
+
+    /** {@inheritDoc} */
+    public void warn( Throwable error )
+    {
+        logger.warn( "", error );
+    }
+
+    /** {@inheritDoc} */
+    public void error( CharSequence content )
+    {
+        logger.error( toString( content ) );
+    }
+
+    /** {@inheritDoc} */
+    public void error( CharSequence content, Throwable error )
+    {
+        logger.error( toString( content ), error );
+    }
+
+    /** {@inheritDoc} */
+    public void error( Throwable error )
+    {
+        logger.error( "", error );
+    }
+
+    /** {@inheritDoc} */
+    public boolean isDebugEnabled()
+    {
+        return logger.isDebugEnabled();
+    }
+
+    /** {@inheritDoc} */
+    public boolean isInfoEnabled()
+    {
+        return logger.isInfoEnabled();
+    }
+
+    /** {@inheritDoc} */
+    public boolean isWarnEnabled()
+    {
+        return logger.isWarnEnabled();
+    }
+
+    /** {@inheritDoc} */
+    public boolean isErrorEnabled()
+    {
+        return logger.isErrorEnabled();
+    }
+
+    // ----------------------------------------------------------------------
+    // Private methods
+    // ----------------------------------------------------------------------
+
+    private String toString( CharSequence content )
+    {
+        if ( content == null )
+        {
+            return "";
+        }
+
+        return content.toString();
+    }
+}

Property changes on: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/DefaultLog.java
___________________________________________________________________
Name: svn:keywords
   + "Author Date Id Revision"
Name: svn:eol-style
   + native

Index: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/LogEnabled.java
===================================================================
--- doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/LogEnabled.java	(revision 0)
+++ doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/LogEnabled.java	(revision 0)
@@ -0,0 +1,46 @@
+package org.apache.maven.doxia.logging;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+
+/**
+ * An interface for Doxia components that need the ability to log.
+ *
+ * @author ltheussl
+ * @version $Id$
+ * @since 1.0-beta-1
+ */
+public interface LogEnabled
+{
+    /**
+     * Sets a logger for this Doxia component.
+     *
+     * @param log a Log.
+     */
+    void setLog( Log log );
+
+    /**
+     * Returns the logger that has been configured for this Doxia component.
+     *
+     * @return Log.
+     * @todo not sure this is necessary here?
+     */
+    Log getLog();
+}

Property changes on: doxia-logging-api/src/main/java/org/apache/maven/doxia/logging/LogEnabled.java
___________________________________________________________________
Name: svn:keywords
   + "Author Date Id Revision"
Name: svn:eol-style
   + native

Index: doxia-logging-api/pom.xml
===================================================================
--- doxia-logging-api/pom.xml	(revision 0)
+++ doxia-logging-api/pom.xml	(revision 0)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>doxia</artifactId>
+    <groupId>org.apache.maven.doxia</groupId>
+    <version>1.0-beta-1-SNAPSHOT</version>
+  </parent>
+  <artifactId>doxia-logging-api</artifactId>
+  <name>Doxia :: Sink API</name>
+  <description>Doxia Logging API.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>

Property changes on: doxia-logging-api/pom.xml
___________________________________________________________________
Name: svn:keywords
   + "Author Date Id Revision"
Name: svn:eol-style
   + native

Index: doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java
===================================================================
--- doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java	(revision 620661)
+++ doxia-core/src/test/java/org/apache/maven/doxia/sink/TextSink.java	(working copy)
@@ -27,7 +27,7 @@
  * Useful for testing purposes.
  */
 public class TextSink
-    implements Sink
+    extends AbstractSink
 {
 
     /** System-dependent end-of-line string. */
@@ -582,7 +582,7 @@
         }
         catch ( IOException e )
         {
-            // TODO: log
+            getLog().debug( "Could not flush sink: " + e.getMessage(), e );
         }
     }
 
@@ -595,7 +595,7 @@
         }
         catch ( IOException e )
         {
-            // TODO: log
+            getLog().debug( "Could not close sink: " + e.getMessage(), e );
         }
     }
 
@@ -613,7 +613,7 @@
         }
         catch ( IOException e )
         {
-            // TODO: log
+            getLog().warn( "Could not write to sink: " + e.getMessage(), e );
         }
     }
 
Index: doxia-core/src/test/java/org/apache/maven/doxia/WellformednessCheckingSink.java
===================================================================
--- doxia-core/src/test/java/org/apache/maven/doxia/WellformednessCheckingSink.java	(revision 620661)
+++ doxia-core/src/test/java/org/apache/maven/doxia/WellformednessCheckingSink.java	(working copy)
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.AbstractSink;
 
 import java.util.LinkedList;
 import java.util.List;
@@ -33,7 +33,7 @@
  * @version $Id$
  */
 public class WellformednessCheckingSink
-    implements Sink
+    extends AbstractSink
 {
     private Stack elements = new Stack();
 
Index: doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/macro/Macro.java	(working copy)
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.doxia.logging.LogEnabled;
 import org.apache.maven.doxia.sink.Sink;
 
 /**
@@ -29,6 +30,7 @@
  * @since 1.0
  */
 public interface Macro
+    extends LogEnabled
 {
     /** The Plexus lookup role. */
     String ROLE = Macro.class.getName();
Index: doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/macro/AbstractMacro.java	(working copy)
@@ -19,6 +19,9 @@
  * under the License.
  */
 
+import org.apache.maven.doxia.logging.Log;
+import org.apache.maven.doxia.logging.SystemStreamLog;
+
 /**
  * Abstract base class to execute <code>Macro</code>.
  *
@@ -29,7 +32,36 @@
 public abstract class AbstractMacro
     implements Macro
 {
+    /** Log instance. */
+    private Log log;
+
     /**
+     * Sets a logger for this macro.
+     *
+     * @param log a Log.
+     */
+    public void setLog( Log log )
+    {
+        this.log = log;
+    }
+
+    /**
+     * Returns a logger for this macro.
+     * If no logger has been configured, a new SystemStreamLog is returned.
+     *
+     * @return Log
+     */
+    public Log getLog()
+    {
+        if ( log == null )
+        {
+            log = new SystemStreamLog();
+        }
+
+        return log;
+    }
+
+    /**
      * Check if the given parameter is required. Throws an
      * IllegalArgumentException if paramValue is null or empty.
      *
Index: doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/sink/SinkAdapter.java	(working copy)
@@ -28,7 +28,7 @@
  * @version $Id$
  */
 public class SinkAdapter
-    implements Sink
+    extends AbstractSink
 {
     /** {@inheritDoc} */
     public void head()
Index: doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java	(revision 0)
+++ doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java	(revision 0)
@@ -0,0 +1,64 @@
+package org.apache.maven.doxia.sink;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+import org.apache.maven.doxia.logging.Log;
+import org.apache.maven.doxia.logging.SystemStreamLog;
+
+
+/**
+ * An abstract base class that defines some convenience methods for sinks.
+ *
+ * @author ltheussl
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ * @since 1.0-beta-1
+ */
+public abstract class AbstractSink
+    implements Sink
+{
+    private Log log;
+
+    /**
+     * Sets a logger for this sink.
+     *
+     * @param log a Log.
+     */
+    public void setLog( Log log )
+    {
+        this.log = log;
+    }
+
+    /**
+     * Returns a logger for this sink.
+     * If no logger has been configured, a new SystemStreamLog is returned.
+     *
+     * @return Log
+     */
+    public Log getLog()
+    {
+        if ( log == null )
+        {
+            log = new SystemStreamLog();
+        }
+
+        return log;
+    }
+}

Property changes on: doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractSink.java
___________________________________________________________________
Name: svn:keywords
   + "Author Date Id Revision"
Name: svn:eol-style
   + native

Index: doxia-core/src/main/java/org/apache/maven/doxia/DefaultDoxia.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/DefaultDoxia.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/DefaultDoxia.java	(working copy)
@@ -19,12 +19,15 @@
  * under the License.
  */
 
+import org.apache.maven.doxia.logging.DefaultLog;
 import org.apache.maven.doxia.parser.ParseException;
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.parser.manager.ParserManager;
 import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
 import org.apache.maven.doxia.sink.Sink;
 
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
 import java.io.Reader;
 
 /**
@@ -37,6 +40,7 @@
  * @plexus.component
  */
 public class DefaultDoxia
+    extends AbstractLogEnabled
     implements Doxia
 {
     /**
@@ -56,6 +60,8 @@
     {
         Parser parser = parserManager.getParser( parserId );
 
+        parser.setLog( new DefaultLog( getLogger() ) );
+
         parser.parse( source, sink );
     }
 
Index: doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractParser.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractParser.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractParser.java	(working copy)
@@ -21,6 +21,8 @@
 
 import java.io.File;
 
+import org.apache.maven.doxia.logging.Log;
+import org.apache.maven.doxia.logging.SystemStreamLog;
 import org.apache.maven.doxia.macro.Macro;
 import org.apache.maven.doxia.macro.MacroExecutionException;
 import org.apache.maven.doxia.macro.MacroRequest;
@@ -28,6 +30,7 @@
 import org.apache.maven.doxia.macro.manager.MacroNotFoundException;
 import org.apache.maven.doxia.sink.Sink;
 
+
 /**
  * An abstract base class that defines some convenience methods for parsers.
  * Provides a macro mechanism to give dynamic functionalities for the parsing.
@@ -46,6 +49,9 @@
     /** @plexus.requirement */
     protected MacroManager macroManager;
 
+    /** Log instance. */
+    private Log log;
+
     /** {@inheritDoc} */
     public int getType()
     {
@@ -68,6 +74,8 @@
     {
         Macro macro = macroManager.getMacro( macroId );
 
+        macro.setLog( getLog() );
+
         macro.execute( sink, request );
     }
 
@@ -99,4 +107,31 @@
     {
         this.secondParsing = second;
     }
+
+
+    /**
+     * Sets a logger for this parser.
+     *
+     * @param log a Log.
+     */
+    public void setLog( Log log )
+    {
+        this.log = log;
+    }
+
+    /**
+     * Returns the current logger for this parser.
+     * If no logger has been configured yet, a new SystemStreamLog is returned.
+     *
+     * @return Log
+     */
+    public Log getLog()
+    {
+        if ( log == null )
+        {
+            log = new SystemStreamLog();
+        }
+
+        return log;
+    }
 }
Index: doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java	(working copy)
@@ -45,6 +45,8 @@
     public void parse( Reader source, Sink sink )
         throws ParseException
     {
+        sink.setLog( getLog() );
+
         try
         {
             XmlPullParser parser = new MXParser();
Index: doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java	(working copy)
@@ -528,7 +528,14 @@
     {
         if ( !baseStartTag( parser, sink ) )
         {
-            // TODO: log( "Unrecognized start tag!" );
+            if ( getLog().isWarnEnabled() )
+            {
+                String position = "[" + parser.getLineNumber() + ":"
+                    + parser.getColumnNumber() + "]";
+                String tag = "<" + parser.getName() + ">";
+
+                getLog().warn( "Unrecognized tag: " + tag + " at " + position );
+            }
         }
     }
 
@@ -543,7 +550,14 @@
     {
         if ( !baseEndTag( parser, sink ) )
         {
-            // TODO: log( "Unrecognized end tag!" );
+            if ( getLog().isWarnEnabled() )
+            {
+                String position = "[" + parser.getLineNumber() + ":"
+                    + parser.getColumnNumber() + "]";
+                String tag = "<" + parser.getName() + ">";
+
+                getLog().warn( "Unrecognized tag: " + tag + " at " + position );
+            }
         }
     }
 
Index: doxia-core/src/main/java/org/apache/maven/doxia/parser/Parser.java
===================================================================
--- doxia-core/src/main/java/org/apache/maven/doxia/parser/Parser.java	(revision 620661)
+++ doxia-core/src/main/java/org/apache/maven/doxia/parser/Parser.java	(working copy)
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.doxia.logging.LogEnabled;
 import org.apache.maven.doxia.sink.Sink;
 
 import java.io.Reader;
@@ -33,6 +34,7 @@
  * @since 1.0
  */
 public interface Parser
+    extends LogEnabled
 {
     /** The Plexus lookup role. */
     String ROLE = Parser.class.getName();
Index: doxia-core/pom.xml
===================================================================
--- doxia-core/pom.xml	(revision 620661)
+++ doxia-core/pom.xml	(working copy)
@@ -84,6 +84,10 @@
       <artifactId>doxia-sink-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.doxia</groupId>
+      <artifactId>doxia-logging-api</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
Index: doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
===================================================================
--- doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java	(revision 620661)
+++ doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java	(working copy)
@@ -215,7 +215,14 @@
         {
             // TODO: remove
             handleRawText( sink, parser );
-            // TODO: log( "Unrecognized tag!" );
+            if ( getLog().isWarnEnabled() )
+            {
+                String position = "[" + parser.getLineNumber() + ":"
+                    + parser.getColumnNumber() + "]";
+                String tag = "<" + parser.getName() + ">";
+
+                getLog().warn( "Unrecognized tag: " + tag + " at " + position );
+            }
         }
     }
 
Index: doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java
===================================================================
--- doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java	(revision 620661)
+++ doxia-sink-api/src/main/java/org/apache/maven/doxia/sink/Sink.java	(working copy)
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import org.apache.maven.doxia.logging.LogEnabled;
+
 /**
  * A <i>Sink</i> consumes Doxia events in a resultant output format like
  * Docbook, PDF, or XHTML.
@@ -54,6 +56,7 @@
  * @version $Id$
  */
 public interface Sink
+    extends LogEnabled
 {
     /**
      * The Plexus Sink Role
Index: doxia-sink-api/pom.xml
===================================================================
--- doxia-sink-api/pom.xml	(revision 620661)
+++ doxia-sink-api/pom.xml	(working copy)
@@ -29,4 +29,12 @@
   <artifactId>doxia-sink-api</artifactId>
   <name>Doxia :: Sink API</name>
   <description>Doxia Sink API.</description>
+
+  <dependencies>
+      <dependency>
+        <groupId>org.apache.maven.doxia</groupId>
+        <artifactId>doxia-logging-api</artifactId>
+      </dependency>
+  </dependencies>
+
 </project>

