4343namespace cuttlefish {
4444namespace {
4545
46- using Subprocess::StdIOChannel::kStdErr ;
47-
4846// Holds all sockets related to a single vhost user input device process.
4947struct DeviceSockets {
5048 // Device end of the connection between device and streamer.
@@ -129,18 +127,20 @@ class VhostInputDevices : public CommandSource,
129127 std::vector<MonitorCommand> commands;
130128 Command rotary_cmd =
131129 NewVhostUserInputCommand (rotary_sockets_, DefaultRotaryDeviceSpec ());
132- Command rotary_log_tee = CF_EXPECT (
133- log_tee_.CreateLogTee (rotary_cmd, " vhost_user_rotary" , kStdErr ),
134- " Failed to create log tee command for rotary device" );
130+ Command rotary_log_tee =
131+ CF_EXPECT (log_tee_.CreateLogTee (rotary_cmd, " vhost_user_rotary" ,
132+ Subprocess::StdIOChannel::kStdErr ),
133+ " Failed to create log tee command for rotary device" );
135134 commands.emplace_back (std::move (rotary_cmd));
136135 commands.emplace_back (std::move (rotary_log_tee));
137136
138137 if (instance_.enable_mouse ()) {
139138 Command mouse_cmd =
140139 NewVhostUserInputCommand (mouse_sockets_, DefaultMouseSpec ());
141- Command mouse_log_tee = CF_EXPECT (
142- log_tee_.CreateLogTee (mouse_cmd, " vhost_user_mouse" , kStdErr ),
143- " Failed to create log tee command for mouse device" );
140+ Command mouse_log_tee =
141+ CF_EXPECT (log_tee_.CreateLogTee (mouse_cmd, " vhost_user_mouse" ,
142+ Subprocess::StdIOChannel::kStdErr ),
143+ " Failed to create log tee command for mouse device" );
144144 commands.emplace_back (std::move (mouse_cmd));
145145 commands.emplace_back (std::move (mouse_log_tee));
146146 }
@@ -149,17 +149,19 @@ class VhostInputDevices : public CommandSource,
149149 instance_.custom_keyboard_config ().value_or (DefaultKeyboardSpec ());
150150 Command keyboard_cmd =
151151 NewVhostUserInputCommand (keyboard_sockets_, keyboard_spec);
152- Command keyboard_log_tee = CF_EXPECT (
153- log_tee_.CreateLogTee (keyboard_cmd, " vhost_user_keyboard" , kStdErr ),
154- " Failed to create log tee command for keyboard device" );
152+ Command keyboard_log_tee =
153+ CF_EXPECT (log_tee_.CreateLogTee (keyboard_cmd, " vhost_user_keyboard" ,
154+ Subprocess::StdIOChannel::kStdErr ),
155+ " Failed to create log tee command for keyboard device" );
155156 commands.emplace_back (std::move (keyboard_cmd));
156157 commands.emplace_back (std::move (keyboard_log_tee));
157158
158159 Command switches_cmd =
159160 NewVhostUserInputCommand (switches_sockets_, DefaultSwitchesSpec ());
160- Command switches_log_tee = CF_EXPECT (
161- log_tee_.CreateLogTee (switches_cmd, " vhost_user_switches" , kStdErr ),
162- " Failed to create log tee command for switches device" );
161+ Command switches_log_tee =
162+ CF_EXPECT (log_tee_.CreateLogTee (switches_cmd, " vhost_user_switches" ,
163+ Subprocess::StdIOChannel::kStdErr ),
164+ " Failed to create log tee command for switches device" );
163165 commands.emplace_back (std::move (switches_cmd));
164166 commands.emplace_back (std::move (switches_log_tee));
165167
@@ -185,11 +187,11 @@ class VhostInputDevices : public CommandSource,
185187 " Failed to write touchscreen spec to file: {}" , spec_path);
186188 Command touchscreen_cmd =
187189 NewVhostUserInputCommand (touchscreen_sockets_[i], spec_path);
188- Command touchscreen_log_tee =
189- CF_EXPECTF ( log_tee_.CreateLogTee (
190- touchscreen_cmd ,
191- fmt::format ( " vhost_user_touchscreen_{} " , i), kStdErr ),
192- " Failed to create log tee for touchscreen device" , i);
190+ Command touchscreen_log_tee = CF_EXPECTF (
191+ log_tee_.CreateLogTee (touchscreen_cmd,
192+ fmt::format ( " vhost_user_touchscreen_{} " , i) ,
193+ Subprocess::StdIOChannel:: kStdErr ),
194+ " Failed to create log tee for touchscreen device" , i);
193195 commands.emplace_back (std::move (touchscreen_cmd));
194196 commands.emplace_back (std::move (touchscreen_log_tee));
195197 }
@@ -212,10 +214,11 @@ class VhostInputDevices : public CommandSource,
212214 " Failed to write touchpad spec to file: {}" , spec_path);
213215 Command touchpad_cmd =
214216 NewVhostUserInputCommand (touchpad_sockets_[i], spec_path);
215- Command touchpad_log_tee = CF_EXPECTF (
216- log_tee_.CreateLogTee (
217- touchpad_cmd, fmt::format (" vhost_user_touchpad_{}" , i), kStdErr ),
218- " Failed to create log tee for touchpad {}" , i);
217+ Command touchpad_log_tee =
218+ CF_EXPECTF (log_tee_.CreateLogTee (
219+ touchpad_cmd, fmt::format (" vhost_user_touchpad_{}" , i),
220+ Subprocess::StdIOChannel::kStdErr ),
221+ " Failed to create log tee for touchpad {}" , i);
219222 commands.emplace_back (std::move (touchpad_cmd));
220223 commands.emplace_back (std::move (touchpad_log_tee));
221224 }
0 commit comments