Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Microsoft Onnxruntime OrtLoggingLevel

From Leeroopedia
Revision as of 15:47, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Microsoft_Onnxruntime_OrtLoggingLevel.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment