本文整理汇总了Java中org.pentaho.di.core.logging.LogChannel.logError方法的典型用法代码示例。如果您正苦于以下问题:Java LogChannel.logError方法的具体用法?Java LogChannel.logError怎么用?Java LogChannel.logError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.logging.LogChannel
的用法示例。
在下文中一共展示了LogChannel.logError方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractPreviewRowsXulDialog
import org.pentaho.di.core.logging.LogChannel; //导入方法依赖的package包/类
public AbstractPreviewRowsXulDialog( Object parent, BaseStepMeta stepMeta, int maxRows ) {
this.xulFile = "org/pentaho/di/ui/xul/common/preview/xul/preview_rows.xul";
this.parent = parent;
this.meta = stepMeta;
this.maxRows = maxRows;
log = new LogChannel( "Row Preview" );
try {
initializeXul();
progressMeter = (XulProgressmeter) document.getElementById( "progress" );
} catch ( Exception e ) {
log.logError( "Error initializing dialog...", e );
throw new IllegalStateException( "Cannot load dialog due to error in initialization.", e );
}
}
示例2: getCommandLineArgs
import org.pentaho.di.core.logging.LogChannel; //导入方法依赖的package包/类
public static CommandLineOption[] getCommandLineArgs(List<String> args) {
CommandLineOption[] clOptions = new CommandLineOption[] {
new CommandLineOption("rep", "Repository name", new StringBuffer()),
new CommandLineOption("user", "Repository username", new StringBuffer()),
new CommandLineOption("pass", "Repository password", new StringBuffer()),
new CommandLineOption("job", "The name of the job to launch", new StringBuffer()),
new CommandLineOption("trans", "The name of the transformation to launch", new StringBuffer()),
new CommandLineOption("dir", "The directory (don't forget the leading /)", new StringBuffer()),
new CommandLineOption("file", "The filename (Transformation in XML) to launch", new StringBuffer()),
new CommandLineOption("level", "The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing)",
new StringBuffer()), new CommandLineOption("logfile", "The logging file to write to", new StringBuffer()),
new CommandLineOption("log", "The logging file to write to (deprecated)", new StringBuffer(), false, true), };
// start with the default logger until we find out otherwise
//
log = new LogChannel(APP_NAME);
// Parse the options...
if (!CommandLineOption.parseArguments(args, clOptions, log)) {
log.logError("Command line option not understood");
System.exit(8);
}
String kettleRepname = Const.getEnvironmentVariable("KETTLE_REPOSITORY", null);
String kettleUsername = Const.getEnvironmentVariable("KETTLE_USER", null);
String kettlePassword = Const.getEnvironmentVariable("KETTLE_PASSWORD", null);
if (!Const.isEmpty(kettleRepname))
clOptions[0].setArgument(new StringBuffer(kettleRepname));
if (!Const.isEmpty(kettleUsername))
clOptions[1].setArgument(new StringBuffer(kettleUsername));
if (!Const.isEmpty(kettlePassword))
clOptions[2].setArgument(new StringBuffer(kettlePassword));
return clOptions;
}
示例3: getCommandLineArgs
import org.pentaho.di.core.logging.LogChannel; //导入方法依赖的package包/类
public static CommandLineOption[] getCommandLineArgs(List<String> args) {
CommandLineOption[] clOptions = new CommandLineOption[] {
new CommandLineOption("rep", "Repository name", new StringBuffer()),
new CommandLineOption("user", "Repository username", new StringBuffer()),
new CommandLineOption("pass", "Repository password", new StringBuffer()),
new CommandLineOption("job", "The name of the job to launch", new StringBuffer()),
new CommandLineOption("trans", "The name of the transformation to launch", new StringBuffer()),
new CommandLineOption("dir", "The directory (don't forget the leading /)", new StringBuffer()),
new CommandLineOption("file", "The filename (Transformation in XML) to launch", new StringBuffer()),
new CommandLineOption("level", "The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing)",
new StringBuffer()), new CommandLineOption("logfile", "The logging file to write to", new StringBuffer()),
new CommandLineOption("log", "The logging file to write to (deprecated)", new StringBuffer(), false, true),
new CommandLineOption("perspective", "The perspective to start in", new StringBuffer(), false, true)};
// start with the default logger until we find out otherwise
//
log = new LogChannel(APP_NAME);
// Parse the options...
if (!CommandLineOption.parseArguments(args, clOptions, log)) {
log.logError("Command line option not understood");
System.exit(8);
}
String kettleRepname = Const.getEnvironmentVariable("KETTLE_REPOSITORY", null);
String kettleUsername = Const.getEnvironmentVariable("KETTLE_USER", null);
String kettlePassword = Const.getEnvironmentVariable("KETTLE_PASSWORD", null);
if (!Const.isEmpty(kettleRepname))
clOptions[0].setArgument(new StringBuffer(kettleRepname));
if (!Const.isEmpty(kettleUsername))
clOptions[1].setArgument(new StringBuffer(kettleUsername));
if (!Const.isEmpty(kettlePassword))
clOptions[2].setArgument(new StringBuffer(kettlePassword));
return clOptions;
}
示例4: ParametersTab
import org.pentaho.di.core.logging.LogChannel; //导入方法依赖的package包/类
public ParametersTab( CTabFolder tabFolder, PropsUI props, TransMeta transMeta, CallEndpointMeta metaInfo,
ModifyListener modifyListener, String stepName, LogChannel log ) {
super( tabFolder, BaseMessages.getString( PKG, "CallEndpointDialog.TabItem.Parameters.Title" ), props );
ColumnInfo cFieldName =
new ColumnInfo( BaseMessages.getString( PKG, "CallEndpointDialog.TabItem.Parameters.Field" ),
ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false );
ColumnInfo cParameter =
new ColumnInfo( BaseMessages.getString( PKG, "CallEndpointDialog.TabItem.Parameters.Parameter" ),
ColumnInfo.COLUMN_TYPE_TEXT, false );
cParameter.setUsingVariables( true );
ColumnInfo cDefaultValue =
new ColumnInfo( BaseMessages.getString( PKG, "CallEndpointDialog.TabItem.Parameters.Default" ),
ColumnInfo.COLUMN_TYPE_TEXT, false );
cDefaultValue.setUsingVariables( true );
cDefaultValue.setToolTip( BaseMessages.getString( PKG, "SetSessionVariableDialog.Column.DefaultValue.Tooltip" ) );
queryParameters = new TableViewBuilder( props, this, transMeta )
.addColumnInfo( cFieldName )
.addColumnInfo( cParameter )
.addColumnInfo( cDefaultValue )
.setRowsCount( metaInfo.getFieldName().length )
.setModifyListener( modifyListener )
.setLeftPlacement( LEFT_PLACEMENT )
.setRightPlacement( RIGHT_PLACEMENT )
.setTopPlacement( 0 )
.setBottomPlacement( 100 )
.build();
StepMeta stepMeta = transMeta.findStep( stepName );
if ( stepMeta != null ) {
try {
// get field names from previous steps
RowMetaInterface row = transMeta.getPrevStepFields( stepMeta );
List<String> entries = new ArrayList<String>();
for ( int i = 0; i < row.size(); i++ ) {
entries.add( row.getValueMeta( i ).getName() );
}
String[] fieldNames = entries.toArray( new String[ entries.size() ] );
// sort field names and add them to the combo box
Const.sortStrings( fieldNames );
cFieldName.setComboValues( fieldNames );
} catch ( KettleException e ) {
log.logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ) );
}
}
}
示例5: generateJarFile
import org.pentaho.di.core.logging.LogChannel; //导入方法依赖的package包/类
public static final void generateJarFile(TransMeta transMeta)
{
log = new LogChannel("Jar file generator");
KettleDependencies deps = new KettleDependencies(transMeta);
File kar = new File("kar");
if (kar.exists())
{
log.logBasic("Jar generator", "Removing directory: "+kar.getPath());
deleteDirectory(kar);
}
kar.mkdir();
String filename = "kettle-engine-3.0.jar";
if (!Const.isEmpty(transMeta.getFilename()))
{
filename = Const.replace(transMeta.getFilename(), " ", "_").toLowerCase()+".kar";
}
File karFile = new File(filename);
try
{
// The manifest file
String strManifest = "";
strManifest += "Manifest-Version: 1.0"+Const.CR;
strManifest += "Created-By: Kettle version "+Const.VERSION+Const.CR;
strManifest += Attributes.Name.MAIN_CLASS.toString()+": " + (JarPan.class.getName()) + Const.CR;
// Create a new manifest file in the root.
File manifestFile = new File(kar.getPath()+"/"+"manifest.mf");
FileOutputStream fos = new FileOutputStream(manifestFile);
fos.write(strManifest.getBytes());
fos.close();
log.logBasic("Jar generator", "Wrote manifest file: "+manifestFile.getPath());
// The transformation, also in the kar directory...
String strTrans = XMLHandler.getXMLHeader(Const.XML_ENCODING) + transMeta.getXML();
File transFile = new File(kar.getPath()+"/"+TRANSFORMATION_FILENAME);
fos = new FileOutputStream(transFile);
fos.write(strTrans.getBytes(Const.XML_ENCODING));
fos.close();
log.logBasic("Jar generator", "Wrote transformation file: "+transFile.getPath());
// Execute the jar command...
executeJarCommand
(
kar,
karFile,
new File("manifest.mf"),
new File(TRANSFORMATION_FILENAME),
deps.getLibraryFiles()
);
}
catch (Exception e)
{
log.logError(JarfileGenerator.class.getName(), "Error zipping files into archive [" + karFile.getPath() + "] : " + e.toString());
log.logError(JarfileGenerator.class.getName(), Const.getStackTracker(e));
}
}
示例6: generateJarFile
import org.pentaho.di.core.logging.LogChannel; //导入方法依赖的package包/类
public static final void generateJarFile( TransMeta transMeta ) {
log = new LogChannel( "Jar file generator" );
KettleDependencies deps = new KettleDependencies( transMeta );
File kar = new File( "kar" );
if ( kar.exists() ) {
log.logBasic( "Jar generator", "Removing directory: " + kar.getPath() );
deleteDirectory( kar );
}
kar.mkdir();
String filename = "kettle-engine-3.0.jar";
if ( !Utils.isEmpty( transMeta.getFilename() ) ) {
filename = Const.replace( transMeta.getFilename(), " ", "_" ).toLowerCase() + ".kar";
}
File karFile = new File( filename );
try {
// The manifest file
String strManifest = "";
strManifest += "Manifest-Version: 1.0" + Const.CR;
strManifest += "Created-By: Kettle version " + BuildVersion.getInstance().getVersion() + Const.CR;
strManifest += Attributes.Name.MAIN_CLASS.toString() + ": " + ( JarPan.class.getName() ) + Const.CR;
// Create a new manifest file in the root.
File manifestFile = new File( kar.getPath() + "/" + "manifest.mf" );
FileOutputStream fos = new FileOutputStream( manifestFile );
fos.write( strManifest.getBytes() );
fos.close();
log.logBasic( "Jar generator", "Wrote manifest file: " + manifestFile.getPath() );
// The transformation, also in the kar directory...
String strTrans = XMLHandler.getXMLHeader( Const.XML_ENCODING ) + transMeta.getXML();
File transFile = new File( kar.getPath() + "/" + TRANSFORMATION_FILENAME );
fos = new FileOutputStream( transFile );
fos.write( strTrans.getBytes( Const.XML_ENCODING ) );
fos.close();
log.logBasic( "Jar generator", "Wrote transformation file: " + transFile.getPath() );
// Execute the jar command...
executeJarCommand( kar, karFile, new File( "manifest.mf" ), new File( TRANSFORMATION_FILENAME ), deps
.getLibraryFiles() );
} catch ( Exception e ) {
log.logError( JarfileGenerator.class.getName(), "Error zipping files into archive ["
+ karFile.getPath() + "] : " + e.toString() );
log.logError( JarfileGenerator.class.getName(), Const.getStackTracker( e ) );
}
}
示例7: getCommandLineArgs
import org.pentaho.di.core.logging.LogChannel; //导入方法依赖的package包/类
public static CommandLineOption[] getCommandLineArgs( List<String> args ) {
CommandLineOption[] clOptions =
new CommandLineOption[] {
new CommandLineOption( "rep", "Repository name", new StringBuilder() ),
new CommandLineOption( "user", "Repository username", new StringBuilder() ),
new CommandLineOption( "pass", "Repository password", new StringBuilder() ),
new CommandLineOption( "job", "The name of the job to launch", new StringBuilder() ),
new CommandLineOption( "trans", "The name of the transformation to launch", new StringBuilder() ),
new CommandLineOption( "dir", "The directory (don't forget the leading /)", new StringBuilder() ),
new CommandLineOption( "file", "The filename (Transformation in XML) to launch", new StringBuilder() ),
new CommandLineOption(
"level", "The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing)",
new StringBuilder() ),
new CommandLineOption( "logfile", "The logging file to write to", new StringBuilder() ),
new CommandLineOption(
"log", "The logging file to write to (deprecated)", new StringBuilder(), false, true ),
new CommandLineOption( "perspective", "The perspective to start in", new StringBuilder(), false, true ) };
// start with the default logger until we find out otherwise
//
log = new LogChannel( APP_NAME );
// Parse the options...
if ( !CommandLineOption.parseArguments( args, clOptions, log ) ) {
log.logError( "Command line option not understood" );
System.exit( 8 );
}
String kettleRepname = Const.getEnvironmentVariable( "KETTLE_REPOSITORY", null );
String kettleUsername = Const.getEnvironmentVariable( "KETTLE_USER", null );
String kettlePassword = Const.getEnvironmentVariable( "KETTLE_PASSWORD", null );
if ( !Utils.isEmpty( kettleRepname ) ) {
clOptions[0].setArgument( new StringBuilder( kettleRepname ) );
}
if ( !Utils.isEmpty( kettleUsername ) ) {
clOptions[1].setArgument( new StringBuilder( kettleUsername ) );
}
if ( !Utils.isEmpty( kettlePassword ) ) {
clOptions[2].setArgument( new StringBuilder( kettlePassword ) );
}
return clOptions;
}