-
Notifications
You must be signed in to change notification settings - Fork 301
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 qcodes log file for every process id #1816
Unique name for qcodes log file for every process id #1816
Conversation
Cool, On thing to consider is how we handle the roll over. AFAIK the rollover will append dates to the filename too. Do we end up with two dates in the filename (do we care) is there a better way? Should we just remove the rollover now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok to keep the roll-over in case a notebook/kernel is long-running, but then the name of the file should not need to include the date, perhaps some magic hash of the date would be ok ))
Co-Authored-By: Mikhail Astafev <astafan8@gmail.com>
Co-Authored-By: Mikhail Astafev <astafan8@gmail.com>
@astafan8 I also think roll-over may be needed for long-running notebook. I can add date dependent uuid. But it will make the names of the log file very messy. Something like this:
I have not seen users opening the log files very often so we can live with the messy names. However, the only way to find the relevant log files will by sorting them according to dates. |
@lakhotiaharshit and by also looking at the output of |
No, It only gives the location of the command_history.log. It will be good to also add the filename of qcodes.log |
:) is this smth for this PR as well? |
from ipython if start_logger is placed below start_command_history_logger.
Yes, this is taken care of in this PR itself. Now the output of start_all_logging() also contains the location of the qcodes log file as shown below:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes!
Codecov Report
@@ Coverage Diff @@
## master #1816 +/- ##
==========================================
+ Coverage 70.24% 70.25% +0.01%
==========================================
Files 148 148
Lines 18591 18598 +7
==========================================
+ Hits 13059 13066 +7
Misses 5532 5532 |
My impression is that the resulting names are not very practical to use. We will have some long uuids that don't convey any information to the human eye and some dates at the end. So we end up with a directory with a lot of files in random order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
If you wanted to be extra cautious, you could add a test that initiates multiple python processes that log at the same time. But personally I feel that is not worth the time. So I am all for it the way it is now!
One possible solution to the logging_error happening because rollover to a new log file being blocked by another process is to uniquely name the logging file for each process id. In this PR apart from adding the process id, I have also added a date to the file to ensure a) file names are as unique as possible b) they are properly arranged and easier to find.
Though this might clutter ~/.qcodes folder with many log files per day.
@astafan8 @jenshnielsen @Dominik-Vogel
To do:
- http://qcodes.github.io/Qcodes/examples/15_minutes_to_QCoDeS.html?highlight=log