Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type checking to logger #127

Closed
tkevinbest opened this issue Oct 12, 2023 · 1 comment
Closed

Add type checking to logger #127

tkevinbest opened this issue Oct 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@tkevinbest
Copy link
Member

Errors in the logger are very hard to debug. You need to supply names very specifically or you get weird errors.

This syntax worsk:
osl.log.add_attributes(torqueSensor, ["torque"])
but this would fail with a weird error:
osl.log.add_attributes(torqueSensor, "torque")

A check in the add_attributes method would be very helpful!

@tkevinbest tkevinbest added the enhancement New feature or request label Oct 12, 2023
@senthurayyappan
Copy link
Member

Added a type check to the add_attributes() method. It will now raise a [LOGGER] attributes argument must be a list of strings (example: ['a','b']), not {type(attributes)} and fail elegantly when a wrong type is passed.

Please checkout the dev branch [cfb806c].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants