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()
Printer
getFormatter
in interface Printer
public void setFormatter(Formatter formatter)
public SoftWrapper getSoftWrapper()
Printer
getSoftWrapper
in interface Printer
SoftWrapper
is strongly recommended.SoftWrapper.WORD_BREAK_WRAPPER
,
SoftWrapper.WORD_LENGTH_WRAPPER
public void setSoftWrapper(SoftWrapper softWrapper)
public void setStyle(Style style)
public int getMaxLengthPerLine()
Printer
Printer.getSoftWrapper()
returns not null.getMaxLengthPerLine
in interface Printer
public boolean onIntercept(int level, @NonNull String tag, @Nullable Category category, @NonNull String msg)
Interceptor
onIntercept
in interface Interceptor
level
- 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)