Skip to content

Commit

Permalink
add ERROR_ONLY verbose level
Browse files Browse the repository at this point in the history
  • Loading branch information
James Ahlborn committed Jun 5, 2013
1 parent 1b34f54 commit 6b62c32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/cyclopsgroup/jmxterm/boot/CliMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ int execute( String[] args )
{
commandCenter.setVerboseLevel( verboseLevel );
}
if ( verboseLevel != VerboseLevel.SILENT )
if (( verboseLevel != VerboseLevel.SILENT ) &&
( verboseLevel != VerboseLevel.ERROR_ONLY ))
{
output.printMessage( "Welcome to JMX terminal. Type \"help\" for available commands." );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public void printError( Throwable e )
break;
case SILENT:
break;
case ERROR_ONLY:
case BRIEF:
default:
output.printMessage( "#" + ExceptionUtils.getMessage( e ) );
Expand All @@ -71,7 +72,8 @@ public void printError( Throwable e )
@Override
public void printMessage( String message )
{
if ( config.getVerboseLevel() != VerboseLevel.SILENT )
if (( config.getVerboseLevel() != VerboseLevel.SILENT ) &&
( config.getVerboseLevel() != VerboseLevel.ERROR_ONLY ))
{
output.printMessage( "#" + message );
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/cyclopsgroup/jmxterm/io/VerboseLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public enum VerboseLevel
* Nothing is written out except returned values
*/
SILENT,
/**
* Print out errors only
*/
ERROR_ONLY,
/**
* Print out returned value of messages
*/
Expand Down

0 comments on commit 6b62c32

Please sign in to comment.