/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@objectweb.org
 *
 * This library 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 any later version.
 *
 * This library 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.common;

import org.objectweb.util.monolog.api.LoggerFactory;
import org.objectweb.util.monolog.api.Logger;
import org.objectweb.util.monolog.api.BasicLevel;
import org.objectweb.util.monolog.wrapper.printwriter.LoggerImpl;

class DummyLogger extends LoggerImpl {

    /**
     * Dummy Logger used when jotm classes are used on client side
     */

    public void log(int level, java.lang.Object o) {
    }
}

/**
 * This module is used by common/Cmd, common/RemoteObject.jpp and by the classes
 * defined in jonas/rmifilters
 * Traces for module common
 * @author Sebastien Chassande-Barrioz sebastien.chassande@inrialpes.fr
 * Contributor: Ph. Coq
 *
 */
public class TraceCore {

    static public Logger logger = new DummyLogger();
    static public Logger sec = new DummyLogger();
    static public Logger jacc = new DummyLogger();

    static public void configure(LoggerFactory lf) {
        logger = lf.getLogger("org.objectweb.common");
        sec = lf.getLogger("org.objectweb.jonas.security");
        jacc = lf.getLogger("org.objectweb.jonas.security.jacc");
    }


    static public boolean isDebugSec() {
    return (sec != null) && sec.isLoggable(BasicLevel.DEBUG);
    }
}

