-
- All Implemented Interfaces:
public class TaLogThis class is used to show logs ot not. If showLogs is set to true then all logs will be shown to the console. If filePath is set and writeLogsToFile is set to
truethen all logs will also be printed to the file pointed out byfilePath.There are five types of log:
- v for verbose logs.
- d for debug logs.
- i for info logs.
- w for warning logs.
- e for error logs.
- e for error logs with Throwable
- enableLogs enables the library to show logs
- setLogPath Sets the path for the logging file
- setLogLevel Sets the log level
-
-
Method Summary
Modifier and Type Method Description static intgetsLogLevel()static voidv(String tag, @NotNull() String format, Array<Object> args)Logs a verbose message. static voidd(String tag, @NotNull() String format, Array<Object> args)Logs a debug message. static voidi(String tag, @NotNull() String format, Array<Object> args)Logs a info message. static voidw(String tag, @NotNull() String format, Array<Object> args)Logs a warning message. static voide(String tag, @NotNull() String format, Array<Object> args)Logs an error message and an error exception . static voide(String tag, String message, Throwable throwable)Logs an error message and an error exception . static voidenableLogs(boolean showLogs)Enables the library to show logs Default will always print logs, unless user override. static voidenableWriteLogsToFile(boolean writeLogsToFile)Enables the library to print logs to a file. static voidsetLogPath(String path)Sets the path for the logging file, where tasdk c++ logs will be written. static voidsetLogLevel(int logLevel)Sets the log level. static voidsetLogLevel(String topic, int logLevel)Set the logging level for a given topic. static voidsetLogHandler(@Nullable() LogHandler logHandler)Set a log Handler to receive logging messages. -
-
Method Detail
-
getsLogLevel
static int getsLogLevel()
-
v
static void v(String tag, @NotNull() String format, Array<Object> args)
Logs a verbose message.
- Parameters:
tag- used to identify the source of a log message.format- format of the message, if args = null, it will be the message body.args- parameters of the format.
-
d
static void d(String tag, @NotNull() String format, Array<Object> args)
Logs a debug message.
- Parameters:
tag- used to identify the source of a log message.format- format of the message, if args = null, it will be the message body.args- parameters of the format.
-
i
static void i(String tag, @NotNull() String format, Array<Object> args)
Logs a info message.
- Parameters:
tag- used to identify the source of a log message.format- format of the message, if args = null, it will be the message body.args- parameters of the format.
-
w
static void w(String tag, @NotNull() String format, Array<Object> args)
Logs a warning message.
- Parameters:
tag- used to identify the source of a log message.format- format of the message, if args = null, it will be the message body.args- parameters of the format.
-
e
static void e(String tag, @NotNull() String format, Array<Object> args)
Logs an error message and an error exception .
- Parameters:
tag- used to identify the source of a log message.format- format of the message, if args = null, it will be the message body.args- parameters of the format.
-
e
static void e(String tag, String message, Throwable throwable)
Logs an error message and an error exception .
- Parameters:
tag- used to identify the source of a log message.message- the message to be logged.throwable- an exception to log.
-
enableLogs
static void enableLogs(boolean showLogs)
Enables the library to show logs Default will always print logs, unless user override. If log handler set, all logs will dispatch to the handler.
- Parameters:
showLogs-trueif the logs should be shown to console,falseotherwise.
-
enableWriteLogsToFile
static void enableWriteLogsToFile(boolean writeLogsToFile)
Enables the library to print logs to a file. The file's path should be set with setLogPath. Otherwise, if filePath is
Note: enableLogs has a higher priority. If logs are not enabled, no logs will be written to file, even if file writing is enablednullwriting logs to file will fail. Note: setLogHandler has a highest priority, If log handler set, all logs will dispatch to the handler.- Parameters:
writeLogsToFile-trueif the logs should be printed to file,falseotherwise.
-
setLogPath
static void setLogPath(String path)
Sets the path for the logging file, where tasdk c++ logs will be written.
- Parameters:
path- path of the logging file.
-
setLogLevel
static void setLogLevel(int logLevel)
Sets the log level. Can be any value from NavLogLevelType. The log level can be overwritten for specific topic by TaLog.setLogLevel(topic, level)
- Parameters:
logLevel- specifies the granularity of logs.
-
setLogLevel
static void setLogLevel(String topic, int logLevel)
Set the logging level for a given topic. topic is from LogTopics or any other hard string. logLevel can be any value from NavLogLevelType.
- Parameters:
topic- sets log level for specific topics individually and dynamically.logLevel- specifies the granularity of logs.
-
setLogHandler
static void setLogHandler(@Nullable() LogHandler logHandler)
Set a log Handler to receive logging messages. All logs will no longer written to the file or output to the console. If the logHandler is set to null, it means removing LogHandler.
-
-
-
-