facebook4j.internal.logging.StdOutLogger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of facebook4j-core Show documentation
Show all versions of facebook4j-core Show documentation
A Java library for the Facebook Graph API
package facebook4j.internal.logging;
import facebook4j.conf.ConfigurationContext;
/**
* @author Yusuke Yamamoto - yusuke at mac.com
* @since Twitter4J 2.1.1
*/
final class StdOutLogger extends Logger {
private static final boolean DEBUG = ConfigurationContext.getInstance().isDebugEnabled();
/**
* {@inheritDoc}
*/
@Override
public boolean isDebugEnabled() {
return DEBUG;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isInfoEnabled() {
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isWarnEnabled() {
return true;
}
/**
* {@inheritDoc}
*/
@Override
public boolean isErrorEnabled() {
return true;
}
/**
* {@inheritDoc}
*/
@Override
public void debug(String message) {
if (DEBUG) {
System.out.println("[" + new java.util.Date() + "]" + message);
}
}
/**
* {@inheritDoc}
*/
@Override
public void debug(String message, String message2) {
if (DEBUG) {
debug(message + message2);
}
}
/**
* {@inheritDoc}
*/
@Override
public void info(String message) {
System.out.println("[" + new java.util.Date() + "]" + message);
}
/**
* {@inheritDoc}
*/
@Override
public void info(String message, String message2) {
info(message + message2);
}
/**
* {@inheritDoc}
*/
@Override
public void warn(String message) {
System.out.println("[" + new java.util.Date() + "]" + message);
}
/**
* {@inheritDoc}
*/
@Override
public void warn(String message, String message2) {
warn(message + message2);
}
/**
* {@inheritDoc}
*/
@Override
public void error(String message) {
System.out.println("[" + new java.util.Date() + "]" + message);
}
/**
* {@inheritDoc}
*/
@Override
public void error(String message, Throwable th) {
System.out.println(message);
th.printStackTrace(System.err);
}
}