public static final class PLogConfig.Builder extends Object
Constructor and Description |
---|
Builder()
Create a builder, you can also use static method
PLogConfig.newBuilder() . |
Builder(PLogConfig copy)
Create a builder.
|
Modifier and Type | Method and Description |
---|---|
PLogConfig |
build() |
PLogConfig.Builder |
emptyMsg(String val)
Set default message for log printed by calling
PLog.empty() . |
PLogConfig.Builder |
emptyMsgLevel(int val)
Set level for empty log.
|
PLogConfig.Builder |
forceConcatGlobalTag(boolean val)
If set to true, all tags will be appended after global tag, regardless of it is an
auto tag or explicit tag.
|
PLogConfig.Builder |
globalInterceptor(Interceptor val)
Register a global interceptor, useful for handle different app environments etc.
|
PLogConfig.Builder |
globalStackOffset(int val)
Set a global stack offset.
|
PLogConfig.Builder |
globalTag(String val)
Set global tag for all logs, param should not be null.
|
PLogConfig.Builder |
keepLineNumber(boolean val)
Deprecated.
This method name is a little ambiguous, use
needLineNumber(boolean)
instead. |
PLogConfig.Builder |
keepThreadInfo(boolean val)
Deprecated.
This method name is a little ambiguous, use
needThreadInfo(boolean)
instead. |
PLogConfig.Builder |
maxRecursiveDepth(int depth)
Set max depth limit when recursively format objects.
|
PLogConfig.Builder |
needLineNumber(boolean val)
If set to true, the source line number info will be printed in log message.
|
PLogConfig.Builder |
needThreadInfo(boolean val)
If set to true, thread info will be printed into log message.
|
PLogConfig.Builder |
useAutoTag(boolean val)
If set to true(as default option), use class name as tag.
|
public Builder()
PLogConfig.newBuilder()
.public Builder(PLogConfig copy)
public PLogConfig.Builder globalTag(@NonNull String val)
public PLogConfig.Builder forceConcatGlobalTag(boolean val)
public PLogConfig.Builder useAutoTag(boolean val)
public PLogConfig.Builder emptyMsgLevel(int val)
Log.DEBUG
.val
- Must be one of
Log.VERBOSE
, Log.DEBUG
, Log.INFO
,
Log.WARN
, Log.ERROR
.
Otherwise this param is ignored.public PLogConfig.Builder emptyMsg(@NonNull String val)
PLog.empty()
.public PLogConfig.Builder keepLineNumber(boolean val)
needLineNumber(boolean)
instead.public PLogConfig.Builder needLineNumber(boolean val)
public PLogConfig.Builder globalStackOffset(int val)
The recommended value is your wrapper level to `PLog` calls. If you use PLog.xxx() directly, you DO NOT need this method.
public PLogConfig.Builder globalInterceptor(@Nullable Interceptor val)
@Deprecated public PLogConfig.Builder keepThreadInfo(boolean val)
needThreadInfo(boolean)
instead.public PLogConfig.Builder needThreadInfo(boolean val)
public PLogConfig.Builder maxRecursiveDepth(int depth)
depth
- should be positive. pass non-positive value will totally disable
recursive formatting.public PLogConfig build()