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


Java DefaultLogLevel.setLogLevel方法代码示例

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


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

示例1: get

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
public String get(String key, String ... params) {
  String res = null;
  String notFoundKey = "!" + key + "!";
  
  for (String pName : packageNames) {
    // Kettle will generate an exception message if there is a
    // failed message search. Since we are searching over multiple
    // packages, we don't want this message generated unless we
    // cannot find the message in any of the packages.
    LogLevel logLevel = DefaultLogLevel.getLogLevel();
    DefaultLogLevel.setLogLevel(LogLevel.NOTHING);
    try {
      res = BaseMessages.getString(pName, key);
    }
    finally {
      DefaultLogLevel.setLogLevel(logLevel);
    }
    if (!res.equals(notFoundKey)) {
      return res;
    }
  }
  
  // This means we did not find the key, so let Kettle generate
  // its normal error.
  return BaseMessages.getString(packageNames.get(0), key);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:AbstractMessages.java

示例2: ok

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
private void ok()
{
	int idx=wLoglevel.getSelectionIndex();
	DefaultLogLevel.setLogLevel(LogLevel.values()[idx]);
	String filter = wFilter.getText();
	if (Const.isEmpty(filter)) {
	  LogWriter.getInstance().setFilter(null); // clear filter
	} else {
	  LogWriter.getInstance().setFilter(wFilter.getText());
	}
	layout.setTimeAdded(wTime.getSelection());
       
	props.setLogFilter(wFilter.getText());
	props.setLogLevel(wLoglevel.getText());
	props.saveProps();
	
	dispose();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:LogSettingsDialog.java

示例3: get

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
public String get( String key, String... params ) {
  String res = null;
  String notFoundKey = "!" + key + "!";

  for ( String pName : packageNames ) {
    // Kettle will generate an exception message if there is a
    // failed message search. Since we are searching over multiple
    // packages, we don't want this message generated unless we
    // cannot find the message in any of the packages.
    LogLevel logLevel = DefaultLogLevel.getLogLevel();
    DefaultLogLevel.setLogLevel( LogLevel.NOTHING );
    try {
      res = BaseMessages.getString( pName, key );
    } finally {
      DefaultLogLevel.setLogLevel( logLevel );
    }
    if ( !res.equals( notFoundKey ) ) {
      return res;
    }
  }

  // This means we did not find the key, so let Kettle generate
  // its normal error.
  return BaseMessages.getString( packageNames.get( 0 ), key );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:AbstractMessages.java

示例4: ok

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
private void ok() {
  int idx = wLoglevel.getSelectionIndex();
  DefaultLogLevel.setLogLevel( LogLevel.values()[idx] );

  /*
   * String filter = wFilter.getText(); if (Utils.isEmpty(filter)) { LogWriter.getInstance().setFilter(null); // clear
   * filter } else { LogWriter.getInstance().setFilter(wFilter.getText()); } //
   * layout.setTimeAdded(wTime.getSelection());
   */

  // props.setLogFilter(wFilter.getText());
  props.setLogLevel( wLoglevel.getText() );
  props.saveProps();

  dispose();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:LogSettingsDialog.java

示例5: loadSettings

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
public void loadSettings() {
  LogLevel logLevel = LogLevel.getLogLevelForCode(props.getLogLevel());
  DefaultLogLevel.setLogLevel(logLevel);
  log.setLogLevel(logLevel);
  LogWriter.getInstance().setFilter(props.getLogFilter());
  CentralLogStore.getAppender().setMaxNrLines(props.getMaxNrLinesInLog());

  // transMeta.setMaxUndo(props.getMaxUndo());
  DBCache.getInstance().setActive(props.useDBCache());
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:11,代码来源:Spoon.java

示例6: getTranslation

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
protected static String getTranslation(String string, String packageName, String altPackageName, Class<?> resourceClass) {
	
	if (string.startsWith("i18n:")) {
		String[] parts = string.split(":");
		if (parts.length!=3) return string;
		else {
			return BaseMessages.getString(parts[1], parts[2]);
		}
	} else {
		LogLevel oldLogLevel = DefaultLogLevel.getLogLevel();
		
		// avoid i18n messages for missing locale
		//
		DefaultLogLevel.setLogLevel(LogLevel.BASIC);
					
		// Try the default package name
		//
		String translation;
		if (!Const.isEmpty(packageName)) {
			translation=BaseMessages.getString(packageName, string, resourceClass);
			if (translation.startsWith("!") && translation.endsWith("!")) translation=BaseMessages.getString(PKG, string, resourceClass);
		
			// restore loglevel, when the last alternative fails, log it when loglevel is detailed
			//
			DefaultLogLevel.setLogLevel(oldLogLevel);
			if (!Const.isEmpty(altPackageName)) {
				if (translation.startsWith("!") && translation.endsWith("!")) translation=BaseMessages.getString(altPackageName, string, resourceClass);
			}
		} else {
			// Translations are not supported, simply keep the original text.
			//
			translation=string;
		}
		
		return translation;
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:BasePluginType.java

示例7: getTranslation

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
protected static String getTranslation(String string, String packageName, String altPackageName, Class<?> resourceClass) {
	if (string==null) return null;
	
	if (string.startsWith("i18n:")) {
		String[] parts = string.split(":");
		if (parts.length!=3) return string;
		else {
			return BaseMessages.getString(parts[1], parts[2]);
		}
	} else {
		LogLevel oldLogLevel = DefaultLogLevel.getLogLevel();
		
		// avoid i18n messages for missing locale
		//
		DefaultLogLevel.setLogLevel(LogLevel.BASIC);
					
		// Try the default package name
		//
		String translation;
		if (!Const.isEmpty(packageName)) {
			translation=BaseMessages.getString(packageName, string, resourceClass);
			if (translation.startsWith("!") && translation.endsWith("!")) translation=BaseMessages.getString(PKG, string, resourceClass);
		
			// restore loglevel, when the last alternative fails, log it when loglevel is detailed
			//
			DefaultLogLevel.setLogLevel(oldLogLevel);
			if (!Const.isEmpty(altPackageName)) {
				if (translation.startsWith("!") && translation.endsWith("!")) translation=BaseMessages.getString(altPackageName, string, resourceClass);
			}
		} else {
			// Translations are not supported, simply keep the original text.
			//
			translation=string;
		}
		
		return translation;
	}
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:39,代码来源:BasePluginType.java

示例8: loadSettings

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
public void loadSettings() {
  LogLevel logLevel = LogLevel.getLogLevelForCode( props.getLogLevel() );
  DefaultLogLevel.setLogLevel( logLevel );
  log.setLogLevel( logLevel );
  KettleLogStore.getAppender().setMaxNrLines( props.getMaxNrLinesInLog() );

  // transMeta.setMaxUndo(props.getMaxUndo());
  DBCache.getInstance().setActive( props.useDBCache() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:10,代码来源:Spoon.java

示例9: getTranslation

import org.pentaho.di.core.logging.DefaultLogLevel; //导入方法依赖的package包/类
protected static String getTranslation( String string, String packageName, String altPackageName,
  Class<?> resourceClass ) {
  if ( string == null ) {
    return null;
  }

  if ( string.startsWith( "i18n:" ) ) {
    String[] parts = string.split( ":" );
    if ( parts.length != 3 ) {
      return string;
    } else {
      return BaseMessages.getString( parts[1], parts[2] );
    }
  } else {
    // Try the default package name
    //
    String translation;
    if ( !Utils.isEmpty( packageName ) ) {
      LogLevel oldLogLevel = DefaultLogLevel.getLogLevel();

      // avoid i18n messages for missing locale
      //
      DefaultLogLevel.setLogLevel( LogLevel.BASIC );

      translation = BaseMessages.getString( packageName, string, resourceClass );
      if ( translation.startsWith( "!" ) && translation.endsWith( "!" ) ) {
        translation = BaseMessages.getString( PKG, string, resourceClass );
      }

      // restore loglevel, when the last alternative fails, log it when loglevel is detailed
      //
      DefaultLogLevel.setLogLevel( oldLogLevel );
      if ( !Utils.isEmpty( altPackageName ) ) {
        if ( translation.startsWith( "!" ) && translation.endsWith( "!" ) ) {
          translation = BaseMessages.getString( altPackageName, string, resourceClass );
        }
      }
    } else {
      // Translations are not supported, simply keep the original text.
      //
      translation = string;
    }

    return translation;
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:47,代码来源:BasePluginType.java


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