本文整理汇总了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);
}
示例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();
}
示例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 );
}
示例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();
}
示例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());
}
示例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;
}
}
示例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;
}
}
示例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() );
}
示例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;
}
}