Skip to content

Conversation

njooma
Copy link
Member

@njooma njooma commented May 1, 2025

Add trace debug logging. You can enable/disable trace logging by calling enableDebugLogging or disableDebugLogging on a client.

Caveat: You have to do it on a client. When you call fromRobot, you get the base class back. So you'll have to cast it.

final myArm = Arm.fromRobot(robot, "my-arm");
final armClient = myArm as ArmClient;
armClient.enableDebugLogging(traceKey: "arm-logger");
await armClient.move()
armClient.disableDebugLogging()

Got inspiration from
viamrobotics/viam-python-sdk#747
viamrobotics/viam-typescript-sdk#384

@njooma njooma requested a review from a team as a code owner May 1, 2025 20:27
@njooma njooma requested review from lia-viam and stuqdog May 1, 2025 20:27
Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, lgtm!

@njooma njooma merged commit aeb091c into viamrobotics:main May 12, 2025
4 checks passed
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