/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.xwiki.logging;

import org.xwiki.component.annotation.ComponentRole;
import org.xwiki.observation.EventListener;

/**
 * Provide several log related tools.
 * 
 * @version $Id$
 * @since 3.2M3
 */
@ComponentRole
public interface LoggerManager
{
    /**
     * Grab subsequent logs produced by the current thread and send them to the provided listener.
     * <p>
     * They are not sent to the standard log implementation appender or whatever other system is used by the default
     * slf4j implementation. It also override any previous call to {@link #pushLogListener(EventListener)} or
     * {@link #pushLogQueue(LogQueue)} (which will get in on front after a pop).
     * 
     * @param listener the listener that will receive logging events.
     */
    void pushLogListener(EventListener listener);

    /**
     * Automatically create and push a listener to fill the provided queue.
     * 
     * @param queue the queue where to store log events
     * @see #pushLogListener(EventListener)
     */
    void pushLogQueue(LogQueue queue);

    /**
     * Remove the current listener from the current thread stack.
     * <p>
     * If several listeners has been pushed it restore previous one.
     * 
     * @return the previous log events listener for the current thread
     */
    EventListener popLogListener();
}

@@ -1033,32 +1033,128 @@
 de s
-everal log related tools
+ome logging management APIs such as the ability to redirect logs to an %7B@link EventListener%7D or to a%0A * %7B@link LogQueue%7D
 .%0A *
@@ -1369,148 +1369,72 @@
   * 
-They are not sent to the standard log implementation appender or whatever other system is used by the default%0A     * slf4j implementa
+Note that the logs are not sent anymore to SLF4J. In addi
 tion
-. I
+, i
 t al
@@ -1444,16 +1444,17 @@
 override
+s
  any pre
@@ -1466,16 +1466,23 @@
  call to
+%0A     *
  %7B@link 
@@ -1516,23 +1516,16 @@
 ner)%7D or
-%0A     *
  %7B@link 
@@ -1569,31 +1569,69 @@
 get 
-in on front after a pop
+active again after%0A     * a call to %7B@link #popLogListener()%7D
 ).%0A 
@@ -1691,16 +1691,27 @@
 receive 
+all future 
 logging 
@@ -1716,17 +1716,16 @@
 g events
-.
 %0A     */
@@ -1811,16 +1811,17 @@
 y create
+s
  and pus
@@ -1821,16 +1821,18 @@
 and push
+es
  a liste
@@ -1862,16 +1862,173 @@
 d queue.
+ To disable logging to the passed queue%0A     * you need to call %7B@link #popLogListener()%7D which will remove the Listener that has been automatically created.
 %0A     * 
@@ -2068,14 +2068,16 @@
 ere 
-to sto
+all futu
 re l
@@ -2081,24 +2081,39 @@
 e log events
+ will be stored
 %0A     * @see
@@ -2308,17 +2308,18 @@
 eners ha
-s
+ve
  been pu
@@ -2330,14 +2330,16 @@
  it 
-restor
+makes th
 e pr
@@ -2348,16 +2348,29 @@
 ious one
+ active again
 .%0A     *

Improve javadoc a bit (I hope I understood pushLogQueue... :))