Package

Source Code of Additivity

/**
* Copyright (C) 2001-2003 France Telecom R&D
*
* 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 of the License, or (at your option) 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
*/

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.Monolog;

/**
*
* @author Sebastien Chassande-Barrioz
*/
public class Additivity {
  public static void main(String[] args) {
    LoggerFactory lf;
    switch(args.length) {
    case 0:
      //Let monolog find the monolog.properties in the classpath or use
      // the default configuration
      lf = Monolog.initialize();
      break;
    case 1:
      // A monolog configuration file has been specified, then use it
      lf = Monolog.getMonologFactory(args[0]);
      break;
    default:
      System.out.println("Syntax error!\nUsage: java Additivity [<monolog file name>]");
      return;
    }
    Logger l = lf.getLogger("monolog.examples.additivity.foo.bar");
    l.log(BasicLevel.DEBUG, "This is an additivity example");
  }
}
TOP

Related Classes of Additivity

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.