/** * Log minimal. * * @param message the message */ public void logMinimal( String message ) { log.logMinimal( message ); }
/** * Logs the specified string at the minimal level. * * @param message * the message */ public void logMinimal( String message ) { log.logMinimal( message ); }
/** * Log minimal. * * @param message the message * @param arguments the arguments */ public void logMinimal( String message, Object... arguments ) { log.logMinimal( message, arguments ); }
/** * Logs the specified string and arguments at the minimal level. * * @param message * the message * @param arguments * the arguments */ public void logMinimal( String message, Object... arguments ) { log.logMinimal( message, arguments ); }
public void logMinimal( String s ) { log.logMinimal( s ); }
/** * Log minimal. * * @param message the message */ public void logMinimal( String message ) { getLog().logMinimal( message ); }
/** * Log minimal. * * @param message the message * @param arguments the arguments */ public void logMinimal( String message, Object... arguments ) { getLog().logMinimal( message, arguments ); }
String end = getDateFormat().format( stop ).toString(); getLog().logMinimal( BaseMessages.getString( getPkgClazz(), startStopMsgTkn, begin, end ) ); getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterMsgTkn, String.valueOf( seconds ) ) ); } else if ( seconds <= 60 * 60 ) { int min = ( seconds / 60 ); int rem = ( seconds % 60 ); getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterLongMsgTkn, String.valueOf( min ), String.valueOf( rem ), String.valueOf( seconds ) ) ); } else if ( seconds <= 60 * 60 * 24 ) { int min = rem / 60; rem = rem % 60; getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterLongerMsgTkn, String.valueOf( hour ), String.valueOf( min ), String.valueOf( rem ), String.valueOf( seconds ) ) ); } else { int min = rem / 60; rem = rem % 60; getLog().logMinimal( BaseMessages.getString( getPkgClazz(), processingEndAfterLongestMsgTkn, String.valueOf( days ), String.valueOf( hour ), String.valueOf( min ), String.valueOf( rem ), String.valueOf( seconds ) ) );
@Test public void testLogMinimal() { streamLogger = new ConfigurableStreamLogger( log, is, LogLevel.MINIMAL, PREFIX ); streamLogger.run(); Mockito.verify( log ).logMinimal( OUT1 ); Mockito.verify( log ).logMinimal( OUT2 ); }
public void safeStop() { if ( running && !halting ) { halting = true; safeStopping = true; trans.safeStop(); log.logMinimal( BaseMessages.getString( PKG, "TransLog.Log.TransformationSafeStopped" ) ); initialized = false; halted = false; setControlStates(); transMeta.setInternalKettleVariables(); // set the original vars back as they may be changed by a mapping } }
/** * * {@link org.apache.commons.vfs2.provider.sftp.SftpFileSystem#executeCommand(java.lang.String, java.lang.StringBuilder) } */ private int executeCommand( String command, StringBuilder output ) throws JSchException, IOException { this.ensureSession(); ChannelExec channel = (ChannelExec) this.session.openChannel( "exec" ); channel.setCommand( command ); channel.setInputStream( (InputStream) null ); InputStreamReader stream = new InputStreamReader( channel.getInputStream() ); channel.setErrStream( System.err, true ); channel.connect(); char[] buffer = new char[128]; int read; while ( ( read = stream.read( buffer, 0, buffer.length ) ) >= 0 ) { output.append( buffer, 0, read ); } stream.close(); while ( !channel.isClosed() ) { try { Thread.sleep( 100L ); } catch ( Exception exc ) { log.logMinimal( "Warning: Error session closing. " + exc.getMessage() ); } } channel.disconnect(); return channel.getExitStatus(); }
@Override public void setParameter( FileSystemOptions opts, String name, String value, String fullParameterName, String vfsUrl ) throws IOException { // Use the DelgatingFileSystemOptionsBuilder to insert generic parameters // This must be done to assure the correct VFS FileSystem drivers will process the parameters String scheme = extractScheme( fullParameterName ); try { DelegatingFileSystemOptionsBuilder delegateFSOptionsBuilder = new DelegatingFileSystemOptionsBuilder( KettleVFS.getInstance().getFileSystemManager() ); if ( scheme != null ) { delegateFSOptionsBuilder.setConfigString( opts, scheme, name, value ); } else { log.logMinimal( "Warning: Cannot process VFS parameters if no scheme is specified: " + vfsUrl ); } } catch ( FileSystemException e ) { if ( ( e.getCode() != null ) && ( e.getCode().equalsIgnoreCase( "vfs.provider/config-key-invalid.error" ) ) ) { // This key is not supported by the default scheme config builder. This may be a custom key of another config // builder log.logMinimal( "Warning: The configuration parameter [" + name + "] is not supported by the default configuration builder for scheme: " + scheme ); } else { // An unexpected error has occurred loading in parameters throw new IOException( e.getLocalizedMessage(), e ); } } } }
private void checkTransEnded() { if ( trans != null ) { if ( trans.isFinished() && ( running || halted ) ) { log.logMinimal( BaseMessages.getString( PKG, "TransLog.Log.TransformationHasFinished" ) ); running = false; initialized = false; halted = false; halting = false; safeStopping = false; setControlStates(); // OK, also see if we had a debugging session going on. // If so and we didn't hit a breakpoint yet, display the show // preview dialog... // if ( debug && lastTransDebugMeta != null && lastTransDebugMeta.getTotalNumberOfHits() == 0 ) { debug = false; showLastPreviewResults(); } debug = false; checkErrorVisuals(); shell.getDisplay().asyncExec( new Runnable() { @Override public void run() { spoon.fireMenuControlers(); redraw(); } } ); } } }
public synchronized void stopJob() { if ( job != null && job.isActive() && job.isInitialized() ) { job.stopAll(); job.waitUntilFinished( 5000 ); // wait until everything is stopped, maximum 5 seconds... log.logMinimal( BaseMessages.getString( PKG, "JobLog.Log.JobWasStopped" ) ); } setControlStates(); }
@Override protected void append( LoggingEvent event ) { String s = layout.format( event ); if ( Level.DEBUG.equals( event.getLevel() ) ) { log.logDebug( s ); } else if ( Level.ERROR.equals( event.getLevel() ) || Level.FATAL.equals( event.getLevel() ) ) { Throwable t = event.getThrowableInformation() == null ? null : event.getThrowableInformation().getThrowable(); if ( t == null ) { log.logError( s ); } else { log.logError( s, t ); } } else if ( Level.TRACE.equals( event.getLevel() ) ) { log.logRowlevel( s ); } else if ( Level.OFF.equals( event.getLevel() ) ) { log.logMinimal( s ); } else { // ALL, WARN, INFO, or others log.logBasic( s ); } }
switch ( this.logLevel ) { case MINIMAL: log.logMinimal( logEntry ); break; case BASIC:
@Override public void stepFinished( Trans trans, StepMeta stepMeta, StepInterface step ) { synchronized ( Trans.this ) { nrOfFinishedSteps++; if ( nrOfFinishedSteps >= steps.size() ) { // Set the finished flag // setFinished( true ); // Grab the performance statistics one last time (if enabled) // addStepPerformanceSnapShot(); try { fireTransFinishedListeners(); } catch ( Exception e ) { step.setErrors( step.getErrors() + 1L ); log.logError( getName() + " : " + BaseMessages.getString( PKG, "Trans.Log.UnexpectedErrorAtTransformationEnd" ), e ); } } // If a step fails with an error, we want to kill/stop the others // too... // if ( step.getErrors() > 0 ) { log.logMinimal( BaseMessages.getString( PKG, "Trans.Log.TransformationDetectedErrors" ) ); log.logMinimal( BaseMessages.getString( PKG, "Trans.Log.TransformationIsKillingTheOtherSteps" ) ); killAllNoWait(); } } } };
/** * This gets called at the very end, when everything is done. */ protected void jobFinished() { // Do a final check to see if it all ended... // if ( job != null && job.isInitialized() && job.isFinished() ) { for ( RefreshListener listener : refreshListeners ) { listener.refreshNeeded(); } jobMetricsDelegate.resetLastRefreshTime(); jobMetricsDelegate.updateGraph(); log.logMinimal( BaseMessages.getString( PKG, "JobLog.Log.JobHasEnded" ) ); } setControlStates(); }
public void stop() { if ( safeStopping ) { modalMessageDialog( getString( "TransLog.Log.SafeStopAlreadyStarted.Title" ), getString( "TransLog.Log.SafeStopAlreadyStarted" ), SWT.ICON_ERROR | SWT.OK ); return; } if ( ( running && !halting ) ) { halting = true; trans.stopAll(); log.logMinimal( BaseMessages.getString( PKG, "TransLog.Log.ProcessingOfTransformationStopped" ) ); running = false; initialized = false; halted = false; halting = false; setControlStates(); transMeta.setInternalKettleVariables(); // set the original vars back as they may be changed by a mapping } }
private void logToChannel( LogChannelInterface logChannel, LogEntry data ) { LogLevel logLogLevel = data.getLogLogLevel(); switch ( logLogLevel ) { case ERROR: if ( data.getThrowable() != null ) { logChannel.logError( data.getMessage(), data.getThrowable() ); } else { logChannel.logError( data.getMessage() ); } break; case MINIMAL: logChannel.logMinimal( data.getMessage() ); break; case BASIC: logChannel.logBasic( data.getMessage() ); break; case DETAILED: logChannel.logDetailed( data.getMessage() ); break; case DEBUG: logChannel.logDebug( data.getMessage() ); break; case TRACE: logChannel.logRowlevel( data.getMessage() ); break; } }