Class Diagnostics
- java.lang.Object
-
- com.azure.android.ai.vision.common.Diagnostics
-
public final class Diagnostics extends Object
Native logging and other diagnostics
-
-
Constructor Summary
Constructors Constructor Description Diagnostics()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
dumpMemoryLog(String filename, String linePrefix, boolean emitToStdOut, boolean emitToStdErr)
Dumps the contents of the memory loggerstatic void
dumpMemoryLogOnExit(String filename, String linePrefix, boolean emitToStdOut, boolean emitToStdErr)
Dumps the contents of the memory logger on exitstatic void
logMessage(String message)
Log specific trace messagestatic void
startConsoleLogging()
Starts console (for Android, logcat) loggingstatic void
startConsoleLogging(boolean logToStderr)
Starts console loggingstatic void
startFileLogging(String filename, boolean append)
Enables the native file loggerstatic void
startMemoryLogging()
Enables the native memory loggerstatic void
stopConsoleLogging()
Stops console loggingstatic void
stopFileLogging()
Stops the native file loggerstatic void
stopMemoryLogging()
Stops the native memory logger
-
-
-
Method Detail
-
startConsoleLogging
public static final void startConsoleLogging(boolean logToStderr)
Starts console logging- Parameters:
logToStderr
- Whether the log should be emitted to standard error or standard out.
-
startConsoleLogging
public static final void startConsoleLogging()
Starts console (for Android, logcat) logging
-
stopConsoleLogging
public static final void stopConsoleLogging()
Stops console logging
-
startMemoryLogging
public static final void startMemoryLogging()
Enables the native memory logger
-
stopMemoryLogging
public static final void stopMemoryLogging()
Stops the native memory logger
-
dumpMemoryLog
public static final 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 neededlinePrefix
- The prefix to apply to each line of logged memory content, e.g. "CRBN"emitToStdOut
- Whether the log should be emitted to standard output in addition to any other targetsemitToStdErr
- Whether the log should be emitted to standard error in addition to any other targets
-
dumpMemoryLogOnExit
public static final 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 neededlinePrefix
- The prefix to apply to each line of logged memory content, e.g. "CRBN"emitToStdOut
- Whether the log should be emitted to standard output in addition to any other targetsemitToStdErr
- Whether the log should be emitted to standard error in addition to any other targets
-
startFileLogging
public static final void startFileLogging(String filename, boolean append)
Enables the native file logger- Parameters:
filename
- The name of resulting log fileappend
- If true will append to file (if already exists). Otherwise will create a new file
-
stopFileLogging
public static final void stopFileLogging()
Stops the native file logger
-
logMessage
public static final void logMessage(String message)
Log specific trace message- Parameters:
message
- The trace message
-
-