Skip to content

Conversation

@tristpinsm
Copy link
Contributor

@tristpinsm tristpinsm commented Apr 23, 2025

During my SMuRF tsar shift I noticed that the logs in the pysmurf controllers were often hard to read due to their volume and the mix of sodetlib / pysmurf / other origins that were sometimes conflicting. I think there might be some improvement possible on the pysmurf side, so I'll create an issue there.

This was one particularly egregious example.

@tristpinsm tristpinsm changed the title Less verbose logging Remove logging of every bias step. Apr 23, 2025
@tristpinsm tristpinsm marked this pull request as ready for review April 23, 2025 18:33
@tristpinsm tristpinsm requested a review from msilvafe April 23, 2025 18:33
Copy link
Contributor

@msilvafe msilvafe left a comment

Choose a reason for hiding this comment

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

I looked into the smurf logger class and couldn't tell exactly how the log verbosity works but do you think it's possible to log this at a higher log level like "debug" in a standard python logger instead of deleting it directly?

@tristpinsm
Copy link
Contributor Author

Yeah, it's not super easy to find, but the log verbosity is defined here. It looks like by default it logs at level 0 (least verbose).

So I could set it to LOG_INFO (1), which (should) suppress these in the pysmurf_controller logs. But to confirm I'd have to test it out I think.

@msilvafe
Copy link
Contributor

msilvafe commented May 1, 2025

Yeah, it's not super easy to find, but the log verbosity is defined here. It looks like by default it logs at level 0 (least verbose).

So I could set it to LOG_INFO (1), which (should) suppress these in the pysmurf_controller logs. But to confirm I'd have to test it out I think.

Ok, is this something your could test on the slac system?

@tristpinsm
Copy link
Contributor Author

what would be easy to do is put in some log statements and play with the verbosity to confirm it behaves as expected.

@tristpinsm
Copy link
Contributor Author

what would be easy to do is put in some log statements and play with the verbosity to confirm it behaves as expected.

OK I've done that and don't see messages logged at S.LOG_INFO level.

@msilvafe msilvafe self-requested a review May 1, 2025 21:49
Copy link
Contributor

@msilvafe msilvafe left a comment

Choose a reason for hiding this comment

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

Ok, great. Not an issue for this PR but how do we change the log levels for the pysmurf logger if someone wanted to get the bias step messages back?

@tristpinsm
Copy link
Contributor Author

Ok, great. Not an issue for this PR but how do we change the log levels for the pysmurf logger if someone wanted to get the bias step messages back?

It's not very obvious, but you can set it with verbose argument to the smurf client object instantiation, or set it later using the set_verbose method. e.g. here

@tristpinsm tristpinsm merged commit 30ae980 into master May 1, 2025
1 check 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.

3 participants