Skip to content

Commit c377859

Browse files
Mark some spammy logs as verbose.
In a very brief usage of cubeb-coreaudio-rs (<1 minute), I observed substantial log output from the following lines: 880 mod.rs:1767 880 mod.rs:1848 1479 mod.rs:3274 1618 mod.rs:1758 2498 mod.rs:1715 3236 mod.rs:1727 8870 device_property.rs:268 8870 device_property.rs:282 9708 mod.rs:2014 Of these, only one (mod.rs:1848) is an error. The others are informational, so make them verbose logs.
1 parent f70ef45 commit c377859

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/backend/device_property.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ pub fn get_device_streams(
265265
debug_assert!(devices.contains(&id));
266266
devices.sort();
267267
let next_id = devices.into_iter().skip_while(|&i| i != id).nth(1);
268-
cubeb_log!(
268+
cubeb_logv!(
269269
"Filtering input streams {:?} for device {}. Next device is {:?}.",
270270
device_streams
271271
.iter()
@@ -279,7 +279,7 @@ pub fn get_device_streams(
279279
} else {
280280
device_streams.retain(|ds| ds.stream > id);
281281
}
282-
cubeb_log!(
282+
cubeb_logv!(
283283
"Input stream filtering for device {} retained {:?}.",
284284
id,
285285
device_streams

src/backend/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ fn get_device_group_id(
17121712
debug_assert_running_serially();
17131713
match get_device_transport_type(id, devtype) {
17141714
Ok(kAudioDeviceTransportTypeBuiltIn) => {
1715-
cubeb_log!(
1715+
cubeb_logv!(
17161716
"The transport type is {:?}",
17171717
convert_uint32_into_string(kAudioDeviceTransportTypeBuiltIn)
17181718
);
@@ -1724,7 +1724,7 @@ fn get_device_group_id(
17241724
};
17251725
}
17261726
Ok(trans_type) => {
1727-
cubeb_log!(
1727+
cubeb_logv!(
17281728
"The transport type is {:?}. Getting model UID instead.",
17291729
convert_uint32_into_string(trans_type)
17301730
);
@@ -1755,7 +1755,7 @@ fn get_custom_group_id(id: AudioDeviceID, devtype: DeviceType) -> Option<CString
17551755
match get_device_source(id, devtype) {
17561756
s @ Ok(IMIC) | s @ Ok(ISPK) => {
17571757
const GROUP_ID: &str = "builtin-internal-mic|spk";
1758-
cubeb_log!(
1758+
cubeb_logv!(
17591759
"Using hardcode group id: {} when source is: {:?}.",
17601760
GROUP_ID,
17611761
convert_uint32_into_string(s.unwrap())
@@ -1764,7 +1764,7 @@ fn get_custom_group_id(id: AudioDeviceID, devtype: DeviceType) -> Option<CString
17641764
}
17651765
s @ Ok(EMIC) | s @ Ok(HDPN) => {
17661766
const GROUP_ID: &str = "builtin-external-mic|hdpn";
1767-
cubeb_log!(
1767+
cubeb_logv!(
17681768
"Using hardcode group id: {} when source is: {:?}.",
17691769
GROUP_ID,
17701770
convert_uint32_into_string(s.unwrap())
@@ -2011,7 +2011,7 @@ fn audiounit_get_devices_of_type(devtype: DeviceType) -> Vec<AudioObjectID> {
20112011
let info = format!("{} ({})", device, label);
20122012

20132013
if let Ok(channels) = get_channel_count(device, devtype) {
2014-
cubeb_log!("Device {} has {} {:?}-channels", info, channels, devtype);
2014+
cubeb_logv!("Device {} has {} {:?}-channels", info, channels, devtype);
20152015
if channels > 0 {
20162016
devices_in_scope.push(device);
20172017
}
@@ -3271,7 +3271,7 @@ impl<'ctx> CoreStreamData<'ctx> {
32713271
debug_assert_running_serially();
32723272
match get_device_transport_type(id, DeviceType::INPUT) {
32733273
Ok(kAudioDeviceTransportTypeBuiltIn) => {
3274-
cubeb_log!(
3274+
cubeb_logv!(
32753275
"Input device {} is on the VPIO force list because it is built in, \
32763276
and its volume is known to be very low without VPIO whenever VPIO \
32773277
is hooked up to it elsewhere.",

0 commit comments

Comments
 (0)