Code Search for Developers
 
 
  

LogConfiguration.java from BIRT at Krugle


Show LogConfiguration.java syntax highlighted

/*
 *************************************************************************
 * Copyright (c) 2004, 2005 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *  
 *************************************************************************
 */

package org.eclipse.birt.data.oda;

/**
 * Encapsulates the trace logging configuration
 * specified for an ODA run-time driver.
 * @deprecated	As of BIRT 2.0, replaced by
 * 		{@link org.eclipse.datatools.connectivity.oda.LogConfiguration 
 * 				org.eclipse.datatools.connectivity.oda.LogConfiguration} .
 * 		<br>The BIRT ODA run-time framework has been migrated to the 
 * 		Eclipse Data Tools Platform (DTP) project.
 */
public class LogConfiguration
{
    private String m_dataSourceId;
    private int m_logLevel;
    private String m_logDirectory;
    private String m_logPrefix;
	private String m_formatterClassName;
    
	/**
	 * Constructor to set the trace logging configuration of the ODA runtime driver
	 * for the given type of data source and its runtime connection(s).
	 * @param dataSourceId      	The id of a type of data source to apply 
	 * 								the logging configuration.  
	 * 							    A null or empty String means to apply to all 
	 * 							    data source types supported by this IDriver.
	 * @param logLevel				The level of information to log. The value of a 
	 * 								log level is implementation dependent of the Logger 
	 * 								used.
	 * @param logDirectory			The absolute path of the log directory.
	 * @param logPrefix				The prefix used in the log file name. For example, 
	 * 								it could be used in the log file format: 
	 * 								&lt;logPrefix&gt;-YYYYMMDD-hhmmss.log, but its usage 
	 * 								is implementation dependent.
	 * @param formatterClassName	The fully qualified class name of a 
	 * 								<code>LogFormatter</code> implementation class.
	 */
	public LogConfiguration( String dataSourceId,
    						 int logLevel, 
    						 String logDirectory,
							 String logPrefix, 
							 String formatterClassName ) 
	{
	    m_dataSourceId = dataSourceId;
	    setLogConfiguration( logLevel, logDirectory,
      		  logPrefix, formatterClassName );
	}

	/**
	 * Constructor to set the trace logging configuration of the 
	 * ODA runtime driver
	 * for all data source types supported by the IDriver.
	 */
	public LogConfiguration( int logLevel, 
					         String logDirectory,
							 String logPrefix, 
							 String formatterClassName ) 
	{
	    setLogConfiguration( logLevel, logDirectory,
	            		  logPrefix, formatterClassName );
	}

    private LogConfiguration()
    {
    }

    private void setLogConfiguration( int logLevel, 
					         String logDirectory,
							 String logPrefix, 
							 String formatterClassName ) 
	{
		m_logLevel = logLevel;

		if( logDirectory != null && logDirectory.length() == 0 )
		    logDirectory = null;
		m_logDirectory = logDirectory;

		if( logPrefix != null && logPrefix.length() == 0 )
		    logPrefix = null;
		m_logPrefix = logPrefix; 

		if( formatterClassName != null && formatterClassName.length() == 0 )
		    formatterClassName = null;
		m_formatterClassName = formatterClassName;
    }
    
    /**
     * Returns the id of a type of data source to apply 
	 * the logging configuration. 
	 * A null or empty String means to apply to all 
	 * data source types supported by this IDriver.
     * @return 	the dataSourceId.
     */
    public String getDataSourceId()
    {
        return m_dataSourceId;
    }
    
    /**
     * Returns the fully qualified class name of a 
	 * <code>LogFormatter</code> implementation class,
	 * suitable for use by the driver-specific logging utility.
     * @return  the formatterClassName, or null if none is configured.
     */
    public String getFormatterClassName()
    {
        return m_formatterClassName;
    }
    
    /**
     * Returns the absolute path of the log directory.
     * @return  the logDirectory, or null if none is configured.
     */
    public String getLogDirectory()
    {
        return m_logDirectory;
    }
    
    /**
	 * Returns the level of information to log. The value of a 
	 * log level is implementation dependent of the Logger used.
     * @return  the logLevel.
     */
    public int getLogLevel()
    {
        return m_logLevel;
    }
    
    /**
     * Returns the prefix used in the log file name. 
     * For example, it could be used in the log file format: 
	 * &lt;logPrefix&gt;-YYYYMMDD-hhmmss.log, but its usage 
	 * is implementation dependent.
     * @return  the logPrefix, or null if none is configured.
     */
    public String getLogPrefix()
    {
        return m_logPrefix;
    }
}




See more files for this project here

BIRT

BIRT is an open source, Eclipse-based reporting system that integrates with your application to produce compelling reports for both web and PDF.

Project homepage: http://www.eclipse.org/birt/phoenix/
Programming language(s): Java,XML
License: gpl2

  impl/
    SimpleConnection.java
    SimpleDataSetMetaData.java
    SimpleDriver.java
    SimpleQuery.java
    SimpleResultSet.java
    SimpleResultSetMetaData.java
    package.html
  util/
    driverconfig/
    logging/
      FileHandler.java
      Filter.java
      Handler.java
      Level.java
      LogFormatter.java
      LogManager.java
      LogRecord.java
      Logger.java
      LoggingErrorHandler.java
      SimpleFormatter.java
      StreamHandler.java
      package.html
    manifest/
      DataSetType.java
      DataTypeMapping.java
      DtpManifestExplorer.java
      ExtensionManifest.java
      JavaRuntimeInterface.java
      ManifestExplorer.java
      Property.java
      PropertyChoice.java
      RuntimeInterface.java
      TraceLogging.java
      package.html
    BirtOdaPlugin.java
    OdaResources.java
    OdaResources_de_DE.msg
    OdaResources_es_ES.msg
    OdaResources_fr_FR.msg
    OdaResources_ja_JP.msg
    OdaResources_ko_KR.msg
    OdaResources_zh_CN.msg
    ResourceCache.java
    ResourceManager.java
    StringSubstitutionUtil.java
    package.html
  IAdvancedQuery.java
  IConnection.java
  IDataSetMetaData.java
  IDriver.java
  IParameterMetaData.java
  IParameterRowSet.java
  IQuery.java
  IResultSet.java
  IResultSetMetaData.java
  LogConfiguration.java
  OdaException.java
  SortSpec.java
  package.html