/*
 * Main.java
 *
 * Created on Wed Jan 14 13:03:12 EST 2004
 *
 * Copyright (c) 2004 Spallation Neutron Source
 * Oak Ridge National Laboratory
 * Oak Ridge, TN 37830
 */

package xal.service.pvlogger;

import xal.extension.service.ServiceDirectory;


/**
 * Main
 *
 * @author  tap
 */
public class Main {
	protected LoggerModel model;
	
	
	/** Main Constructor */
	public Main() {
		model = new LoggerModel();
	}
	
	
	/**
	 * run the service by starting the logger
	 */
	protected void run() {
		model.startLogging();
		new LoggerService(model);
	}
	
	
	/**
	 * Main entry point to the service.  Run the service.
	 * @param args The launch arguments to the service.
	 */
	static public void main(String[] args) {
		new Main().run();
	}
}


@@ -497,29 +497,377 @@
 %7B%0A%09%09
-model.startLogging();
+// get flag to test whether logging should be periodic and on-demand (default) or only on-demand%0A%09%09final boolean periodicLogging = !Boolean.getBoolean( %22xal.logging.noperiod%22 );%0A%09%09if ( periodicLogging ) %7B%0A%09%09%09model.startLogging();%0A%09%09%7D%0A%09%09else %7B%0A%09%09%09System.out.println( %22Warning! Periodic logging has been disabled due to command line flag. Will log on demand only.%22 );%0A%09%09%7D
 %0A%09%09n

Add a flag to the PV Logger service to disable periodic logging and only allow on-demand logging.