Skip to content

Disable log on drop by default - #925

Closed
FireDasher wants to merge 1 commit into
RustAudio:masterfrom
FireDasher:patch-1
Closed

FireDasher wants to merge 1 commit into
RustAudio:masterfrom
FireDasher:patch-1

Conversation

@FireDasher

Copy link
Copy Markdown

Nobody wants this message. It's useless. You should not have to make your stream mutable just to disable this message. I've left the message in in case someone wanted it for debugging, but this should absolutely not be enabled by default, since the program will always close eventually, and it is quite obvious that audio being played by a program will stop when it's terminated.

@roderickvd

Copy link
Copy Markdown
Member

It's difficult to read from a screen, but your "Nobody wants this message. It's useless." comes across as rather harsh.

Have you read back in history or the documentation why it's there?

It's not necessary in the strictly procedural case of "create a stream, play something, sleep, terminate" like the simple terminal examples. In other cases, users do stuff like creating a MyPlayer::new() where they create a handle, add it to the mixer, then are surprised nothing plays because they forgot to store the handle and not just the mixer in their struct.

We have put that message there exactly because it helps lots of users.

We would welcome ideas how to fix this without having to keep the handle around in the struct. Until then, this message stays.

@roderickvd roderickvd closed this Sep 20, 2026
@FireDasher

FireDasher commented Sep 21, 2026

Copy link
Copy Markdown
Author

but your "Nobody wants this message. It's useless." comes across as rather harsh.

Sorry also yeah you make a fair point

@FireDasher

Copy link
Copy Markdown
Author

Maybe you could replace the log_on_drop to instead take self directly and return self so you don't have to make the stream mutable just to disable the message if you didn't want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants