/** * Log the message at a error logging level. * * @param message the message */ public void logError( String message ) { log.logError( message ); }
public static LogChannelInterface getLog() { if ( log == null ) { log = new LogChannel( "ExtensionPointMap" ); } return log; }
/** * Checks if the log level is debug. * * @return true, if the log level is debug, false otherwise */ public boolean isDebug() { return log.isDebug(); }
public void clear() { errorMessage = null; databases = new ArrayList<DatabaseMeta>(); repositories = new ArrayList<RepositoryMeta>(); LogLevel level = null; if ( log != null ) { level = log.getLogLevel(); } setLog( newLogChannel() ); if ( level != null ) { log.setLogLevel( level ); } }
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 ); } }
if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "RepositoryMeta.Log.ConnectionNumber", nrconn ) ); if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "RepositoryMeta.Log.LookingConnection", i ) ); dbcon = new DatabaseMeta( dbnode ); addDatabase( dbcon ); if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadConnection", dbcon.getName() ) ); log.logError( BaseMessages.getString( PKG, "RepositoryMeta.Error.CreatingDatabaseMeta", dbcon.getName() ) ); if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "RepositoryMeta.Log.RepositoryNumber", nrreps ) ); for ( int i = 0; i < nrreps; i++ ) { Node repnode = XMLHandler.getSubNodeByNr( repsnode, RepositoryMeta.XML_TAG, i ); if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "RepositoryMeta.Log.LookingRepository", i ) ); if ( log.isDebug() ) { log.logDebug( BaseMessages .getString( PKG, "RepositoryMeta.Log.ReadRepository", repositoryMeta.getName() ) ); unableToReadIds.append( id ); unableToReadIds.append( "," ); if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "RepositoryMeta.Error.ReadRepositoryId", id ) );
/** * Log the message at a basic logging level. * * @param message the message */ public void logBasic( String message ) { log.logBasic( message ); }
this.objectsMap = new Hashtable<SharedEntry, SharedObjectInterface>(); LogChannel log = new LogChannel( this ); throw kxe; } else { log.logBasic( kxe.getLocalizedMessage() );
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { if ( log.isDebug() ) { log.logDebug( toString(), BaseMessages.getString( PKG, "ZipFileDialog.Log.GettingKeyInfo" ) ); } if ( input.getBaseFolderField() != null ) { wBaseFolderField.setText( input.getBaseFolderField() ); } if ( input.getDynamicSourceFileNameField() != null ) { wSourceFileNameField.setText( input.getDynamicSourceFileNameField() ); } if ( input.getDynamicTargetFileNameField() != null ) { wTargetFileNameField.setText( input.getDynamicTargetFileNameField() ); } wOperation.setText( ZipFileMeta.getOperationTypeDesc( input.getOperationType() ) ); if ( input.getMoveToFolderField() != null ) { wMoveToFolderField.setText( input.getMoveToFolderField() ); } wAddResult.setSelection( input.isaddTargetFileNametoResult() ); wOverwriteZipEntry.setSelection( input.isOverwriteZipEntry() ); wCreateParentFolder.setSelection( input.isCreateParentFolder() ); wKeepFolders.setSelection( input.isKeepSouceFolder() ); wStepname.selectAll(); wStepname.setFocus(); }
if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "RepositoryMeta.Log.NoRepositoryFileInLocalDirectory", file.getAbsolutePath() ) ); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", file.getAbsoluteFile() ) );
/** * Log the message at a debug logging level. * * @param message the message */ public void logDebug( String message ) { log.logDebug( message ); }
public void readDataFromInputStream( InputStream is ) throws KettleException { // Clear the information // clear(); if ( log.isBasic() ) { log.logBasic( BaseMessages.getString( PKG, "RepositoryMeta.Log.ReadingXMLFile", "FromInputStream" ) ); } try { // Check and open XML document DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse( is ); parseRepositoriesDoc( doc ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RepositoryMeta.Error.ReadingInfo" ), e ); } }
@Override public Object answer( InvocationOnMock invocation ) throws Throwable { Object[] args = invocation.getArguments(); LogLevel logLevel = (LogLevel) args[1]; LogLevel channelLogLevel = log.getLogLevel(); if ( !logLevel.isVisible( channelLogLevel ) ) { return null; // not for our eyes. } if ( channelLogLevel.getLevel() >= logLevel.getLevel() ) { LogMessageInterface logMessage = (LogMessageInterface) args[0]; out.write( logMessage.getMessage().getBytes() ); out.write( '\n' ); out.write( '\r' ); out.flush(); return true; } return false; } } ).when( log ).println( (LogMessageInterface) anyObject(), (LogLevel) anyObject() );
public BaseStepGenericXulDialog( String xulFile, Object parent, BaseStepMeta baseStepMeta, TransMeta transMeta, String stepname ) { this.log = new LogChannel( baseStepMeta ); this.transMeta = transMeta; this.stepname = stepname; if ( transMeta != null ) { this.stepMeta = transMeta.findStep( stepname ); } this.baseStepMeta = baseStepMeta; this.xulFile = xulFile; this.parent = parent; try { initializeXul(); } catch ( Exception e ) { e.printStackTrace(); log.logError( "Error initializing (" + stepname + ") step dialog", e ); throw new IllegalStateException( "Cannot load dialog due to error in initialization", e ); } }
/** * Log the message with arguments at a basic logging level. * * @param message the message * @param arguments the arguments */ public void logBasic( String message, Object... arguments ) { log.logBasic( message, arguments ); }
/** * Log the message with arguments at a debug logging level. * * @param message the message * @param arguments the arguments */ public void logDebug( String message, Object... arguments ) { log.logDebug( message, arguments ); }
/** * Log the message with arguments at a error logging level. * * @param message the message * @param arguments the arguments */ public void logError( String message, Object... arguments ) { log.logError( message, arguments ); }
public JobEntryBaseDialog( Shell parent, JobEntryInterface jobEntryInt, Repository rep, JobMeta jobMeta ) { super( parent, jobEntryInt, rep, jobMeta ); log = new LogChannel( jobMeta ); }
public boolean isDebug() { return log.isDebug(); }