当前位置: 首页>>代码示例>>Java>>正文


Java LoggingManager.setPriority方法代码示例

本文整理汇总了Java中org.apache.jorphan.logging.LoggingManager.setPriority方法的典型用法代码示例。如果您正苦于以下问题:Java LoggingManager.setPriority方法的具体用法?Java LoggingManager.setPriority怎么用?Java LoggingManager.setPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jorphan.logging.LoggingManager的用法示例。


在下文中一共展示了LoggingManager.setPriority方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.apache.jorphan.logging.LoggingManager; //导入方法依赖的package包/类
public static void main(String args[]){
    int port = HttpMirrorControl.DEFAULT_PORT;
    if (args.length > 0){
        port = Integer.parseInt(args[0]);
    }
    LoggingManager.setPriority("INFO"); // default level
    LoggingManager.setLoggingLevels(System.getProperties() ); // allow override by system properties
    HttpMirrorServer serv = new HttpMirrorServer(port);
    serv.start();
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:11,代码来源:HttpMirrorServer.java

示例2: processParams

import org.apache.jorphan.logging.LoggingManager; //导入方法依赖的package包/类
protected int processParams(ListIterator<?> args)
		throws UnsupportedOperationException, IllegalArgumentException {
	LoggingManager.setPriority(Priority.INFO);
	PerfMonWorker worker;
	try {
		worker = getWorker();
	} catch (IOException ex) {
		log.error("Error", ex);
		return 0;
	}
	while (args.hasNext()) {
		String nextArg = (String) args.next();
		log.debug("Arg: " + nextArg);
		if (nextArg.equalsIgnoreCase("--tcp-port")) {
			if (!args.hasNext()) {
				throw new IllegalArgumentException("Missing TCP Port no");
			}
			worker.setTCPPort(Integer.parseInt((String) args.next()));
		} else if (nextArg.equals("--loglevel")) {
			args.remove();
			String loglevelStr = (String) args.next();
			LoggingManager.setPriority(loglevelStr);
		} else if (nextArg.equalsIgnoreCase("--interval")) {
			if (!args.hasNext()) {
				throw new IllegalArgumentException("Missing interval specification");
			}
			worker.setInterval(Long.parseLong((String) args.next()));
		} else if (nextArg.equalsIgnoreCase("--udp-port")) {
			if (!args.hasNext()) {
				throw new IllegalArgumentException("Missing UDP Port no");
			}
			worker.setUDPPort(Integer.parseInt((String) args.next()));
		} else if (nextArg.equals("--auto-shutdown")) {
			args.remove();
			worker.setAutoShutdown();
		} else if (nextArg.equals("--sysinfo")) {
			args.remove();
			worker.logSysInfo();
		} else if (nextArg.equals("--agent-version")) {
			args.remove();
			worker.logVersion();
		} else {
			throw new UnsupportedOperationException("Unrecognized option: " + nextArg);
		}
	}
	try {
		worker.startAcceptingCommands();
		while (!worker.isFinished()) {
			worker.processCommands();
		}
	} catch (IOException e) {
		log.error("Error", e);
		return 0;
	}
	return worker.getExitCode();
}
 
开发者ID:junehappylove,项目名称:ServerAgent,代码行数:57,代码来源:AgentTool.java

示例3: runJMeter

import org.apache.jorphan.logging.LoggingManager; //导入方法依赖的package包/类
protected void runJMeter(String className) throws Exception {
	int iterations = Integer.valueOf(getTestConfiguration(className, "iterations", "1"));
	int threads = Integer.valueOf(getTestConfiguration(className, "threads", "1"));

	log.info("starting test " + StringUtils.substringAfterLast(className, "."));

	// loop controller
	LoopController loopController = new LoopController();
	loopController.setLoops(iterations);
	loopController.setFirst(true);
	loopController.initialize();

	// thread group
	ThreadGroup threadGroup = new ThreadGroup();
	threadGroup.setNumThreads(threads);
	threadGroup.setRampUp(1);
	threadGroup.setSamplerController(loopController);

	// JavaSampler
	JavaSampler javaSampler = new JavaSampler();
	javaSampler.setClassname(className);
	javaSampler.setArguments(arguments);

	// summary
	Summariser summariser = new Summariser("summary");
	ResultCollector logger = new ResultCollector(summariser);

	// simple listener to track if at least one test failed
	GlobalResult globalResult = new GlobalResult();

	// create test plan
	TestPlan testPlan = new TestPlan();

	// assemble the test plan from previously initialized elements
	HashTree testPlanHashTree = new HashTree();
	testPlanHashTree.add(testPlan);
	HashTree threadGroupHashTree = new HashTree();
	threadGroupHashTree = testPlanHashTree.add(testPlan, threadGroup);
	HashTree javaSamplerHashTree = new HashTree();
	javaSamplerHashTree = threadGroupHashTree.add(javaSampler);
	javaSamplerHashTree.add(logger);
	javaSamplerHashTree.add(globalResult);

	// start JMeter test
	StandardJMeterEngine jmeter = new StandardJMeterEngine();
	jmeter.configure(testPlanHashTree);
	jmeter.run();

	// increase log level to display the final summary
	LoggingManager.setPriority(Priority.INFO, "jmeter.reporters.Summariser");
	logger.testEnded();
	LoggingManager.setPriority(Priority.WARN, "jmeter.reporters.Summariser");

	// set the JUnit test result
	assertTrue(!globalResult.isFailed());
}
 
开发者ID:savoirfairelinux,项目名称:jmeter-openstack,代码行数:57,代码来源:AbstractOpenstackSamplerTest.java

示例4: setUp

import org.apache.jorphan.logging.LoggingManager; //导入方法依赖的package包/类
@Override
public void setUp(){
    LoggingManager.setPriority("FATAL_ERROR",LoggingManager.removePrefix(Functor.class.getName()));     
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:5,代码来源:TestFunctor.java


注:本文中的org.apache.jorphan.logging.LoggingManager.setPriority方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。