Package com.naver.ads
Class NasLogger
-
- All Implemented Interfaces:
public final class NasLoggerThe logger that can output message with a tag.
-
-
Field Summary
Fields Modifier and Type Field Description private NasLogger.LogLevelpriorityprivate final Stringmessage
-
Method Summary
Modifier and Type Method Description final NasLogger.LogLevelgetPriority()The priority of the logger instance. final UnitsetPriority(NasLogger.LogLevel priority)The priority of the logger instance. final StringgetMessage()final Unitlog()Writes the accumulated messages, then clears messages to start again. final UnitprintLog(String message)Immediately logs a string, ignoring any accumulated contents, which are left unchanged. final Unitappend(String message)Appends the given message to an accumulatedMessage final Unitappend(StringBuilder message)Appends the given message to an accumulatedMessage final Unitappend(String format, Object args)Appends the given format string and arguments to an accumulatedMessage final UnitappendWithKeyValue(String key, Object value)Appends the given key and value string to an accumulatedMessage final static UnitsetLogLevel(NasLogger.LogLevel logLevel)Sets the logging level for this logger. final static Unitv(String tag, String messageOrTemplates, Object args)Logs a verbose-level message final static Unitd(String tag, String messageOrTemplates, Object args)Logs a debug-level message final static Uniti(String tag, String messageOrTemplates, Object args)Logs a information-level message final static Unitw(String tag, String messageOrTemplates, Object args)Logs a warning-level message final static Unite(String tag, String messageOrTemplates, Object args)Logs a error-level message -
-
Method Detail
-
getPriority
final NasLogger.LogLevel getPriority()
The priority of the logger instance.
-
setPriority
final Unit setPriority(NasLogger.LogLevel priority)
The priority of the logger instance.
-
getMessage
final String getMessage()
-
printLog
final Unit printLog(String message)
Immediately logs a string, ignoring any accumulated contents, which are left unchanged.
-
append
final Unit append(StringBuilder message)
Appends the given message to an accumulatedMessage
-
append
final Unit append(String format, Object args)
Appends the given format string and arguments to an accumulatedMessage
-
appendWithKeyValue
final Unit appendWithKeyValue(String key, Object value)
-
setLogLevel
final static Unit setLogLevel(NasLogger.LogLevel logLevel)
Sets the logging level for this logger.
If you'd prefer to lower or higher the verbosity of the NAS SDK diagnostics logs, set the appropriate level.
Note: The default value used when unset is to use LogLevel.DEBUG when
BuildConfig.DEBUGis true, otherwise LogLevel.NONE.- Parameters:
logLevel- the log level.
-
v
final static Unit v(String tag, String messageOrTemplates, Object args)
Logs a verbose-level message
- Parameters:
tag- the tag of the message.messageOrTemplates- the message or template string.args- the arguments referenced by the format specifiers in the template string.
-
d
final static Unit d(String tag, String messageOrTemplates, Object args)
Logs a debug-level message
- Parameters:
tag- the tag of the message.messageOrTemplates- the message or template string.args- the arguments referenced by the format specifiers in the template string.
-
i
final static Unit i(String tag, String messageOrTemplates, Object args)
Logs a information-level message
- Parameters:
tag- the tag of the message.messageOrTemplates- the message or template string.args- the arguments referenced by the format specifiers in the template string.
-
w
final static Unit w(String tag, String messageOrTemplates, Object args)
Logs a warning-level message
- Parameters:
tag- the tag of the message.messageOrTemplates- the message or template string.args- the arguments referenced by the format specifiers in the template string.
-
-
-
-