Package 

Class TaLog

  • All Implemented Interfaces:

    
    public class TaLog
    
                        

    This 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 true then all logs will also be printed to the file pointed out by filePath.

    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
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static int getsLogLevel()
      static void v(String tag, @NotNull() String format, Array<Object> args) Logs a verbose message.
      static void d(String tag, @NotNull() String format, Array<Object> args) Logs a debug message.
      static void i(String tag, @NotNull() String format, Array<Object> args) Logs a info message.
      static void w(String tag, @NotNull() String format, Array<Object> args) Logs a warning message.
      static void e(String tag, @NotNull() String format, Array<Object> args) Logs an error message and an error exception .
      static void e(String tag, String message, Throwable throwable) Logs an error message and an error exception .
      static void enableLogs(boolean showLogs) Enables the library to show logs Default will always print logs, unless user override.
      static void enableWriteLogsToFile(boolean writeLogsToFile) Enables the library to print logs to a file.
      static void setLogPath(String path) Sets the path for the logging file, where tasdk c++ logs will be written.
      static void setLogLevel(int logLevel) Sets the log level.
      static void setLogLevel(String topic, int logLevel) Set the logging level for a given topic.
      static void setLogHandler(@Nullable() LogHandler logHandler) Set a log Handler to receive logging messages.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • 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 - true if the logs should be shown to console, false otherwise.
      • 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 null writing logs to file will fail. Note: setLogHandler has a highest priority, If log handler set, all logs will dispatch to the handler.

        Note: enableLogs has a higher priority. If logs are not enabled, no logs will be written to file, even if file writing is enabled
        Parameters:
        writeLogsToFile - true if the logs should be printed to file, false otherwise.
      • 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.