Added isXXXEnabled() methods to Log.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@168486 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-05-06 01:00:37 +00:00
parent eb0807bb45
commit acabb9d990
3 changed files with 49 additions and 0 deletions

View File

@ -76,4 +76,24 @@ public class DefaultLog
logger.error( "", error );
}
public boolean isDebugEnabled()
{
return logger.isDebugEnabled();
}
public boolean isInfoEnabled()
{
return logger.isInfoEnabled();
}
public boolean isWarnEnabled()
{
return logger.isWarnEnabled();
}
public boolean isErrorEnabled()
{
return logger.isErrorEnabled();
}
}

View File

@ -6,24 +6,32 @@ package org.apache.maven.monitor.logging;
public interface Log
{
boolean isDebugEnabled();
void debug( CharSequence content );
void debug( CharSequence content, Throwable error );
void debug( Throwable error );
boolean isInfoEnabled();
void info( CharSequence content );
void info( CharSequence content, Throwable error );
void info( Throwable error );
boolean isWarnEnabled();
void warn( CharSequence content );
void warn( CharSequence content, Throwable error );
void warn( Throwable error );
boolean isErrorEnabled();
void error( CharSequence content );
void error( CharSequence content, Throwable error );

View File

@ -105,4 +105,25 @@ public class SystemStreamLog
System.out.println( "[" + prefix + "] " + content.toString() + "\n\n" + sWriter.toString() );
}
public boolean isDebugEnabled()
{
// TODO: Not sure how best to set these for this implementation...
return false;
}
public boolean isInfoEnabled()
{
return true;
}
public boolean isWarnEnabled()
{
return true;
}
public boolean isErrorEnabled()
{
return true;
}
}