Controlling raylibs log output?

Anyone know how to stop raylib raylib - Rust from emitting log messages to the console?

I have tried a bunch of suggestions. Like using it's set_trace_log function:

    let (mut rl, thread) = raylib::init().size(640, 480).title("Hello, World").build();

    while !rl.window_should_close() {
        let mut d = rl.begin_drawing(&thread);

        d.draw_text("Hello, world!", 12, 12, 20, Color::BLACK);

and setting the RUST_LOG environment variable:

RUST_LOG="none" ./target/debug/my_prog

to no effect.

I just want log messages from my application. Perhaps errors from raylib.


You can also limit the traces to those coming from your crate: rust - How to turn off tracing events emitted by other crates? - Stack Overflow

Thanks. I have seen that SO answer, or similar, it did not shut off the noise.

But now I look again I see that it does shutoff log messages like these:
INFO: Initializing raylib 3.7
WARNING: GLFW: Error: 65544 Description: Cocoa: Failed to find service port for display
INFO: DISPLAY: Device initialized successfully
INFO: > Display size: 1440 x 900
INFO: > Render size: 640 x 480
INFO: > Screen size: 640 x 480
INFO: > Viewport offsets: 0, 0
INFO: GL: Supported extensions count: 43
INFO: GL: OpenGL device information:
INFO: > Vendor: Apple
INFO: > Renderer: Apple M1
INFO: > Version: 4.1 Metal - 83
INFO: > GLSL: 4.10
INFO: TEXTURE: [ID 1] Texture loaded successfully (1x1 - 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
but it does not shut off other noise I get when I add raylib to my project. Like these:

1   HIToolbox                           0x00000001ad1e05c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120
2   HIToolbox                           0x00000001ad1e0188 _ZN15MenuBarInstance14EnableAutoShowEv + 60
3   HIToolbox                           0x00000001ad183310 SetMenuBarObscured + 372
4   HIToolbox                           0x00000001ad182ee8 _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 172
5   HIToolbox                           0x00000001ad17cfcc _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 296
6   HIToolbox                           0x00000001ad143cd0 _NotifyEventLoopObservers + 176
7   HIToolbox                           0x00000001ad17c96c AcquireEventFromQueue + 432
8   HIToolbox                           0x00000001ad16bc84 ReceiveNextEventCommon + 320
9   HIToolbox                           0x00000001ad16bb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
10  AppKit                              0x00000001a6d18424 _DPSNextEvent + 632
11  AppKit                              0x00000001a6d175b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728

There is thousands of them!

Running on a. MacBook Pro M1 by the way.

I'm not a Mac user, but I found that those logs are Mac-only after consulting a search engine.

That being said, I'm not sure if it's up to a library to silence them, let alone if that's even possible.

Yes. I gave up my search engine consultation when I found that the mentioned "HIToolbox " is a Mac thing. Clearly the are those messages coming from the bowels of my machine. I find no way to deal with them.

It almost sounds like someone left a printf() call in the code when they published it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.