mozilla / cubeb-pulse-rs

ISC License
15 stars 17 forks source link

Fomat log message in rust code #21

Closed achronop closed 6 years ago

achronop commented 6 years ago

Rust and C++ have different format specifiers and this results in broken logs when pulse backend is used in Gecko. This patch contracts the formatted string inside rust code and gives it ready on log_callback.

Fixed:

[CubebOperation #1]: E/cubeb /firefox/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs:90: Requested buffer attributes maxlength 4294967295, tlength 8816, prebuf 4294967295, minreq 2204, fragsize 2204
[CubebOperation #1]: E/cubeb /firefox/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs:90: Output buffer attributes maxlength 4194304, tlength 6608, prebuf 4416, minreq 2200, fragsize 2204

Broken:

[CubebOperation #1]: E/cubeb /firefox/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs:90: Requested buffer attributes maxlength {}, tlength {}, prebuf {}, minreq {}, fragsize {}
[CubebOperation #1]: E/cubeb /firefox/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs:90: Output buffer attributes maxlength {}, tlength {}, prebuf {}, minreq {}, fragsize {}