/*
 * 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.internal.script;

import javax.inject.Named;
import javax.inject.Singleton;

import org.xwiki.component.annotation.Component;
import org.xwiki.script.service.ScriptService;

@Component
@Named("logging")
@Singleton
public class LoggingScriptService implements ScriptService
{
    
}

@@ -931,16 +931,82 @@
 cript;%0A%0A
+import java.util.logging.LogManager;%0A%0Aimport javax.inject.Inject;%0A
 import j
@@ -1105,16 +1105,149 @@
 ponent;%0A
+import org.xwiki.logging.LogQueue;%0Aimport org.xwiki.logging.event.LogQueueListener;%0Aimport org.xwiki.observation.ObservationManager;%0A
 import o
@@ -1391,11 +1391,744 @@
 e%0A%7B%0A    
+@Inject%0A    private LogManager logManager;%0A%0A    @Inject%0A    private ObservationManager observation;%0A%0A    private LogQueue logQueue = new LogQueue();%0A%0A    private LogQueueListener logQueueListener = new LogQueueListener(%22logging.script%22, this.logQueue);%0A%0A    // Get/Set log levels%0A%0A    // LogGueue%0A%0A    public void startLog()%0A    %7B%0A        this.logQueue.clear();%0A        if (this.observation.getListener(this.logQueueListener.getName()) != this.logQueueListener) %7B%0A            this.observation.addListener(this.logQueueListener);%0A        %7D%0A    %7D%0A%0A    public void endLog()%0A    %7B%0A        this.observation.removeListener(this.logQueueListener.getName());%0A    %7D%0A%0A    public LogQueue getLogQueue()%0A    %7B%0A        return this.logQueue;%0A    %7D
 %0A%7D%0A

Introduce a logging administration UI Log listening script APIs