Skip to content

Allow disabling colors in the output #23269

@mrkam2

Description

@mrkam2

Describe the issue

onnxruntime/core/common/logging/sinks/ostream_sink.cc defines message color activator sequences and then uses them unconditionally. When redirecting this output into a file, it becomes less readable. Would be great to have an option to disable the use of colors in the output.

To reproduce

Here is an example of the output captured by the logging system:

2025/01/07 00:02:06 [stderr] �[1;31m2025-01-07 00:02:06.180133144 [E:onnxruntime:Default, provider_bridge_ort.cc:1862 TryGetProviderInfo_CUDA] /onnxruntime_src/onnxruntime/core/session/provider_bridge_ort.cc:1539 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcudnn.so.9: cannot open shared object file: No such file or directory
2025/01/07 00:02:06 [stderr] �[m

Urgency

No response

Platform

Linux

OS Version

Ubuntu 22.04.1

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.16.1

ONNX Runtime API

Python

Architecture

X64

Execution Provider

CUDA

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    core runtimeissues related to core runtimefeature requestrequest for unsupported feature or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions