# OrtSession.RunOptions (onnxruntime 1.15.0 API)

Package ai.onnxruntime

## Class OrtSession.RunOptions

- java.lang.Object
- - ai.onnxruntime.OrtSession.RunOptions

All Implemented Interfaces:
  `java.lang.AutoCloseable`

Enclosing class:
  OrtSession

    public static class OrtSession.RunOptions
    extends java.lang.Object
    implements java.lang.AutoCloseable

Used to control logging and termination of a call to `OrtSession.run(java.util.Map<java.lang.String, ? extends ai.onnxruntime.OnnxTensorLike>)`.

### Constructor Summary

Constructors
`RunOptions()` Creates a RunOptions.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`OrtLoggingLevel` `getLogLevel()` Gets the current logging level set on this RunOptions.
`int` `getLogVerbosityLevel()` Gets the current logging verbosity level set on this RunOptions.
`java.lang.String` `getRunTag()` Gets the String used to log information about this run.
`void` `setLogLevel​(OrtLoggingLevel level)` Sets the current logging level on this RunOptions.
`void` `setLogVerbosityLevel​(int level)` Sets the current logging verbosity level on this RunOptions.
`void` `setRunTag​(java.lang.String runTag)` Sets the run tag used in logging.
`void` `setTerminate​(boolean terminate)` Sets a flag so that all incomplete `OrtSession.run(java.util.Map<java.lang.String, ? extends ai.onnxruntime.OnnxTensorLike>)` calls using this instance of `RunOptions` will terminate as soon as possible.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RunOptions

    public RunOptions()
               throws OrtException

Creates a RunOptions.

Throws:
  `OrtException` - If the construction of the native RunOptions failed.

### Method Detail

#### setLogLevel

    public void setLogLevel​(OrtLoggingLevel level)
                     throws OrtException

Sets the current logging level on this RunOptions.

Parameters:
  `level` - The new logging level.
Throws:
  `OrtException` - If the native call failed.

#### getLogLevel

    public OrtLoggingLevel getLogLevel()
                                throws OrtException

Gets the current logging level set on this RunOptions.

Returns:
  The logging level.
Throws:
  `OrtException` - If the native call failed.

#### setLogVerbosityLevel

    public void setLogVerbosityLevel​(int level)
                              throws OrtException

Sets the current logging verbosity level on this RunOptions.

Parameters:
  `level` - The new logging verbosity level.
Throws:
  `OrtException` - If the native call failed.

#### getLogVerbosityLevel

    public int getLogVerbosityLevel()
                             throws OrtException

Gets the current logging verbosity level set on this RunOptions.

Returns:
  The logging verbosity level.
Throws:
  `OrtException` - If the native call failed.

#### setRunTag

    public void setRunTag​(java.lang.String runTag)
                   throws OrtException

Sets the run tag used in logging.

Parameters:
  `runTag` - The run tag in logging output.
Throws:
  `OrtException` - If the native library call failed.

#### getRunTag

    public java.lang.String getRunTag()
                               throws OrtException

Gets the String used to log information about this run.

Returns:
  The run tag.
Throws:
  `OrtException` - If the native library call failed.

#### setTerminate

    public void setTerminate​(boolean terminate)
                      throws OrtException

Sets a flag so that all incomplete `OrtSession.run(java.util.Map<java.lang.String, ? extends ai.onnxruntime.OnnxTensorLike>)` calls using this instance of `RunOptions` will terminate as soon as possible. If the flag is false, it resets this `RunOptions` so it can be used with other calls to `OrtSession.run(java.util.Map<java.lang.String, ? extends ai.onnxruntime.OnnxTensorLike>)`.

Parameters:
  `terminate` - If true terminate all runs associated with this RunOptions.
Throws:
  `OrtException` - If the native library call failed.

#### close

    public void close()

Specified by:
  `close` in interface `java.lang.AutoCloseable`