public abstract class AbsPrinter extends Object implements Printer
| Constructor and Description |
|---|
AbsPrinter() |
AbsPrinter(int maxLengthPerLine) |
| Modifier and Type | Method and Description |
|---|---|
Formatter |
getFormatter()
Specify the formatter of this printer.
|
int |
getMaxLengthPerLine()
Indicate how many characters should contains in one line; but only affect when soft wrap
is enabled.
|
SoftWrapper |
getSoftWrapper()
Specify word wrapper, if needed.
|
Style |
getStyle() |
boolean |
onIntercept(int level,
String tag,
Category category,
String msg)
Decide whether this item of log should be intercepted.
|
void |
setFormatter(Formatter formatter) |
void |
setInterceptor(Interceptor interceptor) |
void |
setSoftWrapper(SoftWrapper softWrapper) |
void |
setStyle(Style style) |
public AbsPrinter()
public AbsPrinter(int maxLengthPerLine)
@Nullable public Formatter getFormatter()
PrintergetFormatter in interface Printerpublic void setFormatter(Formatter formatter)
public SoftWrapper getSoftWrapper()
PrintergetSoftWrapper in interface PrinterSoftWrapper is strongly recommended.SoftWrapper.WORD_BREAK_WRAPPER,
SoftWrapper.WORD_LENGTH_WRAPPERpublic void setSoftWrapper(SoftWrapper softWrapper)
public void setStyle(Style style)
public int getMaxLengthPerLine()
PrinterPrinter.getSoftWrapper() returns not null.getMaxLengthPerLine in interface Printerpublic boolean onIntercept(int level,
@NonNull
String tag,
@Nullable
Category category,
@NonNull
String msg)
InterceptoronIntercept in interface Interceptorlevel - print level of this log.category - category of this log, if specified.msg - content of this log(before formatting!). Note if msg in the
original request is null, you'll get an empty string here.public void setInterceptor(Interceptor interceptor)