Skip to content

Commit a5dd1db

Browse files
committed
allow custom host and loggerName
1 parent e507d01 commit a5dd1db

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/src/app/robot.dart

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import 'package:viam_sdk/src/gen/google/protobuf/timestamp.pb.dart';
66
import '../gen/app/v1/robot.pbgrpc.dart';
77
import '../gen/common/v1/common.pb.dart';
88

9-
const flutterSdkLoggerName = 'flutter-sdk';
10-
119
/// gRPC client for connecting to app's RobotService.
1210
///
1311
/// All calls must be authenticated.
@@ -17,7 +15,7 @@ class AppRobotClient {
1715
AppRobotClient(this._client);
1816

1917
/// Log the OutputEvent to app with the given partId.
20-
Future<void> log(String partId, OutputEvent event) async {
18+
Future<void> log(String partId, host, loggerName, OutputEvent event) async {
2119
late String level;
2220
switch (event.level) {
2321
case Level.debug:
@@ -37,8 +35,7 @@ class AppRobotClient {
3735
// Join lines with '\n' and suffix with '\n'.
3836
final String message = '${event.lines.join('\n')}\n';
3937

40-
final LogEntry entry =
41-
LogEntry(host: '$partId-$flutterSdkLoggerName', level: level, time: protoTs, loggerName: flutterSdkLoggerName, message: message);
38+
final LogEntry entry = LogEntry(host: host, level: level, time: protoTs, loggerName: loggerName, message: message);
4239
final request = LogRequest(id: partId, logs: [entry]);
4340
await _client.log(request);
4441
}

0 commit comments

Comments
 (0)