Top Description Inners Fields Constructors Methods
com.github.javaparser.utils

public Class Log

extends Object
Class Inheritance
Imports
java.io.IOException, .PrintWriter, .StringWriter, java.util.function.Supplier

To avoid dependencies on logging frameworks, we have invented yet another logging framework :-)

See a blog about this

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static class
Log.SilentAdapter

This adapter logs nothing.

public static class
Log.StandardOutStandardErrorAdapter

This adapter logs to standard out and standard error.

Field Summary

Modifier and TypeField and Description
private static Log.Adapter

Constructor Summary

AccessConstructor and Description
public
Log()

Method Summary

Modifier and TypeMethod and Description
public static void
error(Throwable throwable)

For drawing attention to an error.

public static void
error(Throwable throwable, String format, Supplier<Object>... args)

For drawing attention to an error that you don't have an exception for.

public static void
error(String format, Supplier<Object>... args)

For drawing attention to an error that you don't have an exception for.

public static void
info(String format, Supplier<Object>... args)

For logging things that are nice to see scrolling by.

private static Supplier<String>
public static void
setAdapter(Log.Adapter adapter)

Change how logging is handled.

public static void
trace(String format, Supplier<Object>... args)

For logging information that may help solving a problem.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CURRENT_ADAPTERback to summary
private static Log.Adapter CURRENT_ADAPTER

Constructor Detail

Logback to summary
public Log()

Method Detail

errorback to summary
public static void error(Throwable throwable)

For drawing attention to an error.

errorback to summary
public static void error(Throwable throwable, String format, Supplier<Object>... args)

For drawing attention to an error that you don't have an exception for.

Annotations
@SafeVarargs
errorback to summary
public static void error(String format, Supplier<Object>... args)

For drawing attention to an error that you don't have an exception for.

Annotations
@SafeVarargs
infoback to summary
public static void info(String format, Supplier<Object>... args)

For logging things that are nice to see scrolling by.

Annotations
@SafeVarargs
makeFormattingSupplierback to summary
private static Supplier<String> makeFormattingSupplier(String format, Supplier<Object>[] args)
setAdapterback to summary
public static void setAdapter(Log.Adapter adapter)

Change how logging is handled. You can set your own implementation that forwards to your logging library.

traceback to summary
public static void trace(String format, Supplier<Object>... args)

For logging information that may help solving a problem.

Annotations
@SafeVarargs
com.github.javaparser.utils back to summary

public Interface Log.Adapter

Known Direct Implementers
com.github.javaparser.utils.Log.StandardOutStandardErrorAdapter, com.github.javaparser.utils.Log.SilentAdapter

Method Summary

Modifier and TypeMethod and Description
public void
error(Supplier<Throwable> throwableSupplier, Supplier<String> messageSupplier)

Both can supply a null.

public void
info(Supplier<String> message)

public void
trace(Supplier<String> message)

Method Detail

errorback to summary
public void error(Supplier<Throwable> throwableSupplier, Supplier<String> messageSupplier)

Both can supply a null.

infoback to summary
public void info(Supplier<String> message)
traceback to summary
public void trace(Supplier<String> message)
com.github.javaparser.utils back to summary

public Class Log.SilentAdapter

extends Object
implements Adapter
Class Inheritance
All Implemented Interfaces
com.github.javaparser.utils.Log.Adapter

This adapter logs nothing.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
error(Supplier<Throwable> throwableSupplier, Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.error.

Both can supply a null.
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SilentAdapterback to summary
public SilentAdapter()

Method Detail

errorback to summary
public void error(Supplier<Throwable> throwableSupplier, Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.error.

Doc from com.github.javaparser.utils.Log.Adapter.error.

Both can supply a null.

Annotations
@Override
infoback to summary
public void info(Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.info.

Annotations
@Override
traceback to summary
public void trace(Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.trace.

Annotations
@Override
com.github.javaparser.utils back to summary

public Class Log.StandardOutStandardErrorAdapter

extends Object
implements Adapter
Class Inheritance
  • java.lang.Object
  • com.github.javaparser.utils.Log.StandardOutStandardErrorAdapter
All Implemented Interfaces
com.github.javaparser.utils.Log.Adapter

This adapter logs to standard out and standard error.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
error(Supplier<Throwable> throwableSupplier, Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.error.

Both can supply a null.
public void
private void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StandardOutStandardErrorAdapterback to summary
public StandardOutStandardErrorAdapter()

Method Detail

errorback to summary
public void error(Supplier<Throwable> throwableSupplier, Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.error.

Doc from com.github.javaparser.utils.Log.Adapter.error.

Both can supply a null.

Annotations
@Override
infoback to summary
public void info(Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.info.

Annotations
@Override
printStackTraceback to summary
private void printStackTrace(Throwable throwable)
traceback to summary
public void trace(Supplier<String> messageSupplier)

Implements com.github.javaparser.utils.Log.Adapter.trace.

Annotations
@Override