Class Diagnostics


  • public final class Diagnostics
    extends Object
    Native logging and other diagnostics
    • Constructor Detail

      • Diagnostics

        public Diagnostics()
    • Method Detail

      • startConsoleLogging

        public static void startConsoleLogging​(boolean logToStderr)
        Starts console (for Android, logcat) logging
        Parameters:
        logToStderr - Whether the log should be emitted to standard error or standard out; has no effect on Android.
      • startConsoleLogging

        public static void startConsoleLogging()
        Starts console (for Android, logcat) logging
      • stopConsoleLogging

        public static void stopConsoleLogging()
        Stops console logging
      • startMemoryLogging

        public static void startMemoryLogging()
        Enables the native memory logger
      • stopMemoryLogging

        public static void stopMemoryLogging()
        Stops the native memory logger
      • dumpMemoryLog

        public static void dumpMemoryLog​(String filename,
                                         String linePrefix,
                                         boolean emitToStdOut,
                                         boolean emitToStdErr)
        Dumps the contents of the memory logger
        Parameters:
        filename - The name of the file to write to. Set this to an empty string if not needed
        linePrefix - The prefix to apply to each line of logged memory content, e.g. "CRBN"
        emitToStdOut - Whether the log should be emitted to standard output (for Android, logcat) in addition to any other targets
        emitToStdErr - Whether the log should be emitted to standard error (for Android, logcat) in addition to any other targets
      • dumpMemoryLogOnExit

        public static void dumpMemoryLogOnExit​(String filename,
                                               String linePrefix,
                                               boolean emitToStdOut,
                                               boolean emitToStdErr)
        Dumps the contents of the memory logger on exit
        Parameters:
        filename - The name of the file to write to. Set this to an empty string if not needed
        linePrefix - The prefix to apply to each line of logged memory content, e.g. "CRBN"
        emitToStdOut - Whether the log should be emitted to standard output (for Android, logcat) in addition to any other targets
        emitToStdErr - Whether the log should be emitted to standard error (for Android, logcat) in addition to any other targets
      • startFileLogging

        public static void startFileLogging​(String filename,
                                            boolean append)
        Enables the native file logger
        Parameters:
        filename - The name of resulting log file
        append - If true will append to file (if already exists). Otherwise will create a new file
      • stopFileLogging

        public static void stopFileLogging()
        Stops the native file logger