Class StdLogger
- java.lang.Object
-
- com.android.utils.StdLogger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStdLogger.Level
-
Constructor Summary
Constructors Constructor Description StdLogger(StdLogger.Level level)Creates theStdLoggerwith a given logStdLogger.Level.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(java.lang.Throwable t, java.lang.String errorFormat, java.lang.Object... args)Prints an error message.StdLogger.LevelgetLevel()Returns the logger's logStdLogger.Level.voidinfo(java.lang.String msgFormat, java.lang.Object... args)Prints an info message.voidverbose(java.lang.String msgFormat, java.lang.Object... args)Prints a verbose message.voidwarning(java.lang.String warningFormat, java.lang.Object... args)Prints a warning message.
-
-
-
Constructor Detail
-
StdLogger
public StdLogger(@NonNull StdLogger.Level level)Creates theStdLoggerwith a given logStdLogger.Level.- Parameters:
level- the log Level.
-
-
Method Detail
-
getLevel
public StdLogger.Level getLevel()
Returns the logger's logStdLogger.Level.- Returns:
- the log level.
-
error
public void error(@Nullable java.lang.Throwable t, @Nullable java.lang.String errorFormat, java.lang.Object... args)Prints an error message.
The message will be tagged with "Error" on the output so the caller does not need to put such a prefix in the format string.
The output is done on
This is always displayed, independent of the loggingSystem.err.StdLogger.Level.- Specified by:
errorin interfaceILogger- Parameters:
t- is an optionalThrowableorException. If non-null, it's message will be printed out.errorFormat- is an optional error format. If non-null, it will be printed using aFormatterwith the provided arguments.args- provides the arguments for errorFormat.
-
warning
public void warning(@NonNull java.lang.String warningFormat, java.lang.Object... args)Prints a warning message.
The message will be tagged with "Warning" on the output so the caller does not need to put such a prefix in the format string.
The output is done on
System.out.This is displayed only if the logging
StdLogger.LevelisStdLogger.Level.WARNINGor higher.
-
info
public void info(@NonNull java.lang.String msgFormat, java.lang.Object... args)Prints an info message.
The output is done on
System.out.This is displayed only if the logging
StdLogger.LevelisStdLogger.Level.INFOor higher.
-
verbose
public void verbose(@NonNull java.lang.String msgFormat, java.lang.Object... args)Prints a verbose message.
The output is done on
System.out.This is displayed only if the logging
StdLogger.LevelisStdLogger.Level.VERBOSEor higher.
-
-