Implementation:Microsoft Onnxruntime OrtLoggingLevel: Difference between revisions
Appearance
Auto-imported from implementations/Microsoft_Onnxruntime_OrtLoggingLevel.md |
Sync from local file |
||
| Line 85: | Line 85: | ||
== Related Pages == | == Related Pages == | ||
* [[Microsoft_Onnxruntime_OrtEnvironment|OrtEnvironment.java]] - Uses OrtLoggingLevel during environment creation | * [[Implementation:Microsoft_Onnxruntime_OrtEnvironment|OrtEnvironment.java]] - Uses OrtLoggingLevel during environment creation | ||
[[Category:Implementations]] | [[Category:Implementations]] | ||
[[Category:Implementations]] | [[Category:Implementations]] | ||
Latest revision as of 10:46, 27 September 2026
| Knowledge Sources | Description |
|---|---|
| Source File | java/src/main/java/ai/onnxruntime/OrtLoggingLevel.java |
| Repository | Microsoft/onnxruntime |
Domains
- Machine Learning Runtime
- Logging Configuration
Overview
OrtLoggingLevel is a public enum representing the logging severity levels supported by ONNX Runtime. It maps directly to the C API's logging levels and is used when creating an OrtEnvironment to control the verbosity of native runtime log messages.
Description
Five logging levels are defined:
- ORT_LOGGING_LEVEL_VERBOSE (0): Print all log messages.
- ORT_LOGGING_LEVEL_INFO (1): Print info and higher level messages.
- ORT_LOGGING_LEVEL_WARNING (2): Print warning and higher level messages.
- ORT_LOGGING_LEVEL_ERROR (3): Print error messages only.
- ORT_LOGGING_LEVEL_FATAL (4): Print only fatal messages.
The enum provides getValue() for native integer access and mapFromInt(int) for native-to-Java conversion (defaults to VERBOSE for unknown values).
Code Reference
Source Location
// File: java/src/main/java/ai/onnxruntime/OrtLoggingLevel.java
// Package: ai.onnxruntime
Signature
public enum OrtLoggingLevel {
ORT_LOGGING_LEVEL_VERBOSE(0),
ORT_LOGGING_LEVEL_INFO(1),
ORT_LOGGING_LEVEL_WARNING(2),
ORT_LOGGING_LEVEL_ERROR(3),
ORT_LOGGING_LEVEL_FATAL(4);
public int getValue();
public static OrtLoggingLevel mapFromInt(int logLevel);
}
Import
import ai.onnxruntime.OrtLoggingLevel;
I/O Contract
Inputs
| Name | Type | Description |
|---|---|---|
| logLevel | int | Native integer logging level to map |
Outputs
| Name | Type | Description |
|---|---|---|
| OrtLoggingLevel | OrtLoggingLevel | The corresponding enum constant |
| getValue() | int | The native integer value |
Usage Examples
import ai.onnxruntime.*;
// Create environment with WARNING level logging
OrtEnvironment env = OrtEnvironment.getEnvironment(
OrtLoggingLevel.ORT_LOGGING_LEVEL_WARNING, "my-app");
// For production, use ERROR level
OrtEnvironment prodEnv = OrtEnvironment.getEnvironment(
OrtLoggingLevel.ORT_LOGGING_LEVEL_ERROR);
Related Pages
- OrtEnvironment.java - Uses OrtLoggingLevel during environment creation