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

Unique name for instrument logger #1914

Closed

Conversation

jenshnielsen
Copy link
Collaborator

This ensures that each instrument will have it's own logger so that messages can easily be filtered by instrument instance

An instrument will have a logger with a name of the form module.path.to.instrument.classname-instancename
and in the same way a channel will have a logger with a name of the form module.path.to.instrument.classname-instancename.channelclassname-channelinstancename

@Dominik-Vogel

@jenshnielsen
Copy link
Collaborator Author

If we go that way there should be some tests added

@codecov
Copy link

codecov bot commented Feb 3, 2020

Codecov Report

Merging #1914 into master will decrease coverage by 0.77%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1914      +/-   ##
==========================================
- Coverage   68.92%   68.14%   -0.78%     
==========================================
  Files         156      156              
  Lines       19924    19929       +5     
==========================================
- Hits        13732    13581     -151     
- Misses       6192     6348     +156     

Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

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

this sounds like a good idea, especially since instrument loggers are per-instance.

and tests - yes :) i suggest just simple ones - actual name of the instrument logger and channel logger.

qcodes/instrument/base.py Show resolved Hide resolved
@jenshnielsen jenshnielsen self-assigned this Feb 17, 2020
@jenshnielsen
Copy link
Collaborator Author

This is now replaced by #5297 which will ensure that the instrument_name is an extra attribute on the logrecord from the instrument LoggerAdapter

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.

None yet

2 participants