You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2021/10/04 08:17:48 UTC

[maven] branch mojo-logging created (now 41ba264)

This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a change to branch mojo-logging
in repository https://gitbox.apache.org/repos/asf/maven.git.


      at 41ba264  Mojo Logging proposal

This branch includes the following new commits:

     new 41ba264  Mojo Logging proposal

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[maven] 01/01: Mojo Logging proposal

Posted by cs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch mojo-logging
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 41ba2643df6ad4d4174be30f3122bf82cc2ff270
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Mon Oct 4 10:12:36 2021 +0200

    Mojo Logging proposal
    
    This is a DRAFT to boost some discussion about Mojo
    logging. I believe Maven should not get in a way to
    Maven Plugin developers, but we still can offer
    some "convenience" helpers and make things right
    (like for example logging in ctor of Mojo).
    
    IMHO, we have 3 log-related use cases:
    * trivial to simple Maven Plugins (from one mojo plugin to more mojos + several "own"
      components plugins): here developer can easily choose (and usually choose Mojo Log)
      to do the job. Maven is helping here.
    * complex Maven plugins: plugins pulling in "foreign" frameworks/components/whatever,
      here logging is usually "given", but as Mojo class loader is "self first", it is really
      easy for developer to decide (and implement) which logging it wants (or must) to
      use, Maven should not interfere.
    
    One thing IMHO remains, to make Mojo Log interface more "slf4j Logger"-lookalike.
---
 .../plugin/internal/DefaultMavenPluginManager.java |   7 -
 .../internal/{MojoLogWrapper.java => MojoLog.java} |   8 +-
 .../maven/plugin/internal/MojoLogFactory.java      |  46 +++--
 .../main/resources/META-INF/maven/extension.xml    |   1 +
 .../java/org/apache/maven/plugin/AbstractMojo.java |  42 ++---
 .../org/apache/maven/plugin/ContextEnabled.java    |   4 +-
 .../main/java/org/apache/maven/plugin/Mojo.java    |  23 ---
 .../java/org/apache/maven/plugin/logging/Log.java  |   3 +-
 .../apache/maven/plugin/logging/LogFactory.java    |  62 +++++++
 .../maven/plugin/logging/SystemStreamLog.java      | 201 ---------------------
 .../internal/ILogFactory.java}                     |  23 +--
 11 files changed, 123 insertions(+), 297 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
index ca1910b..fda9315 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java
@@ -30,7 +30,6 @@ import org.apache.maven.plugin.DebugConfigurationListener;
 import org.apache.maven.plugin.ExtensionRealmCache;
 import org.apache.maven.plugin.InvalidPluginDescriptorException;
 import org.apache.maven.plugin.MavenPluginManager;
-import org.apache.maven.plugin.Mojo;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.plugin.MojoNotFoundException;
 import org.apache.maven.plugin.PluginArtifactsCache;
@@ -569,12 +568,6 @@ public class DefaultMavenPluginManager
                 }
             }
 
-            if ( mojo instanceof Mojo )
-            {
-                Logger mojoLogger = LoggerFactory.getLogger( mojoDescriptor.getImplementation() );
-                ( (Mojo) mojo ).setLog( new MojoLogWrapper( mojoLogger ) );
-            }
-
             Xpp3Dom dom = mojoExecution.getConfiguration();
 
             PlexusConfiguration pomConfiguration;
diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLogWrapper.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLog.java
similarity index 96%
rename from maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLogWrapper.java
rename to maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLog.java
index 060dffd..3339488 100644
--- a/maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLogWrapper.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLog.java
@@ -25,14 +25,16 @@ import org.slf4j.Logger;
 import static java.util.Objects.requireNonNull;
 
 /**
- * @author jdcasey
+ * Mojo {@link Log} wrapper using Maven Core logging.
+ *
+ * @since TBD
  */
-public class MojoLogWrapper
+public class MojoLog
     implements Log
 {
     private final Logger logger;
 
-    public MojoLogWrapper( Logger logger )
+    public MojoLog( Logger logger )
     {
         this.logger = requireNonNull( logger );
     }
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLogFactory.java
similarity index 50%
copy from maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java
copy to maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLogFactory.java
index 6851698..759eb53 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java
+++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/MojoLogFactory.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin;
+package org.apache.maven.plugin.internal;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,26 +19,38 @@ package org.apache.maven.plugin;
  * under the License.
  */
 
-import java.util.Map;
+import javax.inject.Named;
+
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugin.logging.LogFactory;
+import org.apache.maven.plugin.logging.internal.ILogFactory;
+import org.eclipse.sisu.EagerSingleton;
+import org.slf4j.LoggerFactory;
 
 /**
- * Interface to allow <code>Mojos</code> to communicate with each others <code>Mojos</code>, other than
- * project's source root and project's attachment.<br>
- * The plugin manager would pull the context out of the plugin container context, and populate it into the Mojo.
+ * Bridge implementation for Mojo {@link Log}.
  *
- * @author jdcasey
+ * @since TBD
  */
-public interface ContextEnabled
+@EagerSingleton
+@Named
+public class MojoLogFactory
+    implements ILogFactory
 {
-    /**
-     * Set a new shared context <code>Map</code> to a mojo before executing it.
-     *
-     * @param pluginContext a new <code>Map</code>
-     */
-    void setPluginContext( Map pluginContext );
+    public MojoLogFactory()
+    {
+        LogFactory.initLogFactory( this ); // init Mojo Logging
+    }
+
+    @Override
+    public Log getLog( final Class<?> clazz )
+    {
+        return new MojoLog( LoggerFactory.getLogger( clazz ) );
+    }
 
-    /**
-     * @return a <code>Map</code> stored in the plugin container's context.
-     */
-    Map getPluginContext();
+    @Override
+    public Log getLog( final String name )
+    {
+        return new MojoLog( LoggerFactory.getLogger( name ) );
+    }
 }
diff --git a/maven-core/src/main/resources/META-INF/maven/extension.xml b/maven-core/src/main/resources/META-INF/maven/extension.xml
index a9e201c..d64bbec 100644
--- a/maven-core/src/main/resources/META-INF/maven/extension.xml
+++ b/maven-core/src/main/resources/META-INF/maven/extension.xml
@@ -35,6 +35,7 @@ under the License.
     <exportedPackage>org.apache.maven.model</exportedPackage>
     <exportedPackage>org.apache.maven.monitor</exportedPackage>
     <exportedPackage>org.apache.maven.plugin</exportedPackage>
+    <exportedPackage>org.apache.maven.plugin.logging</exportedPackage>
     <exportedPackage>org.apache.maven.profiles</exportedPackage>
     <exportedPackage>org.apache.maven.project</exportedPackage>
     <exportedPackage>org.apache.maven.reporting</exportedPackage>
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojo.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojo.java
index 4042f84..c8a82ba 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojo.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/AbstractMojo.java
@@ -22,7 +22,7 @@ package org.apache.maven.plugin;
 import java.util.Map;
 
 import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.plugin.logging.SystemStreamLog;
+import org.apache.maven.plugin.logging.LogFactory;
 
 /**
  * Abstract class to provide most of the infrastructure required to implement a <code>Mojo</code> except for
@@ -144,55 +144,39 @@ public abstract class AbstractMojo
     implements Mojo, ContextEnabled
 {
     /** Instance logger */
-    private Log log;
+    private final Log log = LogFactory.getLog( getClass() );
 
     /** Plugin container context */
-    private Map pluginContext;
+    private Map<String, Object> pluginContext;
 
     /**
-     * @deprecated Use SLF4J directly
+     * Returns the {@link Log} instance this mojo uses (is public for backward compatibility), never returns
+     * {@code null}.
      */
-    @Deprecated
-    @Override
-    public void setLog( Log log )
+    public Log getLog()
     {
-        this.log = log;
+        return log;
     }
 
     /**
-     * <p>
-     * Returns the logger that has been injected into this mojo. If no logger has been setup yet, a
-     * <code>SystemStreamLog</code> logger will be created and returned.
-     * </p>
-     * <strong>Note:</strong>
-     * The logger returned by this method must not be cached in an instance field during the construction of the mojo.
-     * This would cause the mojo to use a wrongly configured default logger when being run by Maven. The proper logger
-     * gets injected by the Plexus container <em>after</em> the mojo has been constructed. Therefore, simply call this
-     * method directly whenever you need the logger, it is fast enough and needs no caching.
+     * Method in place only for backward binary compatibility, otherwise has no effect.
      *
-     * @see org.apache.maven.plugin.Mojo#getLog()
-     * @deprecated Use SLF4J directly
+     * @deprecated This method should not be used, as {@link #log} field is initialized at construction time.
      */
     @Deprecated
-    @Override
-    public Log getLog()
+    public void setLog( Log log )
     {
-        if ( log == null )
-        {
-            log = new SystemStreamLog();
-        }
-
-        return log;
+        // nothing
     }
 
     @Override
-    public Map getPluginContext()
+    public Map<String, Object> getPluginContext()
     {
         return pluginContext;
     }
 
     @Override
-    public void setPluginContext( Map pluginContext )
+    public void setPluginContext( Map<String, Object> pluginContext )
     {
         this.pluginContext = pluginContext;
     }
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java
index 6851698..c07baed 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java
@@ -35,10 +35,10 @@ public interface ContextEnabled
      *
      * @param pluginContext a new <code>Map</code>
      */
-    void setPluginContext( Map pluginContext );
+    void setPluginContext( Map<String, Object> pluginContext );
 
     /**
      * @return a <code>Map</code> stored in the plugin container's context.
      */
-    Map getPluginContext();
+    Map<String, Object> getPluginContext();
 }
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/Mojo.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/Mojo.java
index 0419176..d025e6a 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/Mojo.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/Mojo.java
@@ -19,8 +19,6 @@ package org.apache.maven.plugin;
  * under the License.
  */
 
-import org.apache.maven.plugin.logging.Log;
-
 /**
  * This interface forms the contract required for <code>Mojos</code> to interact with the <code>Maven</code>
  * infrastructure.<br>
@@ -48,25 +46,4 @@ public interface Mojo
      */
     void execute()
         throws MojoExecutionException, MojoFailureException;
-
-    /**
-     * Inject a standard <code>Maven</code> logging mechanism to allow this <code>Mojo</code> to communicate events
-     * and feedback to the user.
-     *
-     * @param log a new logger
-     *
-     * @deprecated Use SLF4J directly
-     */
-    @Deprecated
-    void setLog( Log log );
-
-    /**
-     * Furnish access to the standard Maven logging mechanism which is managed in this base class.
-     *
-     * @return a log4j-like logger object which allows plugins to create messages at levels of <code>"debug"</code>,
-     * <code>"info"</code>, <code>"warn"</code>, and <code>"error"</code>.
-     * @deprecated Use SLF4J directly
-     */
-    @Deprecated
-    Log getLog();
 }
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/Log.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/Log.java
index 04d85bd..6973161 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/Log.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/Log.java
@@ -29,9 +29,8 @@ package org.apache.maven.plugin.logging;
  *
  * @author jdcasey
  *
- * @deprecated Use SLF4J directly
+ * TODO: Make this interface more SLF4J Logger-lookalike.
  */
-@Deprecated
 public interface Log
 {
     /**
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/LogFactory.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/LogFactory.java
new file mode 100644
index 0000000..af32937
--- /dev/null
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/LogFactory.java
@@ -0,0 +1,62 @@
+package org.apache.maven.plugin.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.plugin.logging.internal.ILogFactory;
+
+/**
+ * This interface supplies {@link Log} instances to Mojos. Plugin code may freely use this log factory to obtain
+ * loggers that will be abridged to Maven internal logging system.
+ *
+ * @since TBD
+ */
+public final class LogFactory
+{
+    private static ILogFactory bridge;
+
+    private LogFactory()
+    {
+        // no instances of this can be created
+    }
+
+    /**
+     * Initialized Mojo LogFactory with a bridge.
+     */
+    public static void initLogFactory( ILogFactory bridge )
+    {
+        LogFactory.bridge = bridge;
+    }
+
+    /**
+     * Returns the {@link Log} instance for given class.
+     */
+    public static Log getLog( Class<?> clazz )
+    {
+        return bridge.getLog( clazz );
+    }
+
+    /**
+     * Returns the {@link Log} instance for given name.
+     */
+    public static Log getLog( String name )
+    {
+        return bridge.getLog( name );
+    }
+}
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/SystemStreamLog.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/SystemStreamLog.java
deleted file mode 100644
index f0fc618..0000000
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/SystemStreamLog.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.apache.maven.plugin.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
- *
- * @deprecated Use SLF4J directly
- */
-@Deprecated
-public class SystemStreamLog
-    implements Log
-{
-    /**
-     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence)
-     */
-    public void debug( CharSequence content )
-    {
-        print( "debug", content );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void debug( CharSequence content, Throwable error )
-    {
-        print( "debug", content, error );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#debug(java.lang.Throwable)
-     */
-    public void debug( Throwable error )
-    {
-        print( "debug", error );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence)
-     */
-    public void info( CharSequence content )
-    {
-        print( "info", content );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void info( CharSequence content, Throwable error )
-    {
-        print( "info", content, error );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#info(java.lang.Throwable)
-     */
-    public void info( Throwable error )
-    {
-        print( "info", error );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence)
-     */
-    public void warn( CharSequence content )
-    {
-        print( "warn", content );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void warn( CharSequence content, Throwable error )
-    {
-        print( "warn", content, error );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#warn(java.lang.Throwable)
-     */
-    public void warn( Throwable error )
-    {
-        print( "warn", error );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence)
-     */
-    public void error( CharSequence content )
-    {
-        System.err.println( "[error] " + content.toString() );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence, java.lang.Throwable)
-     */
-    public void error( CharSequence content, Throwable error )
-    {
-        StringWriter sWriter = new StringWriter();
-        PrintWriter pWriter = new PrintWriter( sWriter );
-
-        error.printStackTrace( pWriter );
-
-        System.err.println( "[error] " + content.toString()
-                            + System.lineSeparator() + System.lineSeparator() + sWriter.toString() );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#error(java.lang.Throwable)
-     */
-    public void error( Throwable error )
-    {
-        StringWriter sWriter = new StringWriter();
-        PrintWriter pWriter = new PrintWriter( sWriter );
-
-        error.printStackTrace( pWriter );
-
-        System.err.println( "[error] " + sWriter.toString() );
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#isDebugEnabled()
-     */
-    public boolean isDebugEnabled()
-    {
-        // TODO Not sure how best to set these for this implementation...
-        return false;
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#isInfoEnabled()
-     */
-    public boolean isInfoEnabled()
-    {
-        return true;
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#isWarnEnabled()
-     */
-    public boolean isWarnEnabled()
-    {
-        return true;
-    }
-
-    /**
-     * @see org.apache.maven.plugin.logging.Log#isErrorEnabled()
-     */
-    public boolean isErrorEnabled()
-    {
-        return true;
-    }
-
-    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()
-                            + System.lineSeparator() + System.lineSeparator() + sWriter.toString() );
-    }
-}
diff --git a/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java b/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/internal/ILogFactory.java
similarity index 56%
copy from maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java
copy to maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/internal/ILogFactory.java
index 6851698..b954219 100644
--- a/maven-plugin-api/src/main/java/org/apache/maven/plugin/ContextEnabled.java
+++ b/maven-plugin-api/src/main/java/org/apache/maven/plugin/logging/internal/ILogFactory.java
@@ -1,4 +1,4 @@
-package org.apache.maven.plugin;
+package org.apache.maven.plugin.logging.internal;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,26 +19,23 @@ package org.apache.maven.plugin;
  * under the License.
  */
 
-import java.util.Map;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugin.logging.LogFactory;
 
 /**
- * Interface to allow <code>Mojos</code> to communicate with each others <code>Mojos</code>, other than
- * project's source root and project's attachment.<br>
- * The plugin manager would pull the context out of the plugin container context, and populate it into the Mojo.
+ * This internal interface bridges {@link LogFactory} with Maven internals.
  *
- * @author jdcasey
+ * @since TBD
  */
-public interface ContextEnabled
+public interface ILogFactory
 {
     /**
-     * Set a new shared context <code>Map</code> to a mojo before executing it.
-     *
-     * @param pluginContext a new <code>Map</code>
+     * Returns the {@link Log} instance for given class.
      */
-    void setPluginContext( Map pluginContext );
+    Log getLog( Class<?> clazz );
 
     /**
-     * @return a <code>Map</code> stored in the plugin container's context.
+     * Returns the {@link Log} instance for given name.
      */
-    Map getPluginContext();
+    Log getLog( String name );
 }