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

Skip 'manager.log' when getting log file path #38

Merged
merged 2 commits into from
May 9, 2021
Merged

Skip 'manager.log' when getting log file path #38

merged 2 commits into from
May 9, 2021

Conversation

ianmktu
Copy link
Contributor

@ianmktu ianmktu commented Apr 30, 2021

The view pipeline would sometimes use 'manager.log' as the log file path for a plot, so sometimes plot info would not update correctly.

This proposed change skips the 'manager.log' file.

The view pipeline would sometimes use 'manager.log' as the log file path so plot info would not update correctly.

This proposed change skips the 'manager.log' file.
@swar
Copy link
Owner

swar commented Apr 30, 2021

Ahhh I've never seen this happen before, will add this in later tonight. Good find!

@swar
Copy link
Owner

swar commented May 5, 2021

@ianmktu with the newest version of the code, does this still happen for you? I am trying to figure out why this would end up happening to see if I can fix a bigger issue at hand.

@ianmktu
Copy link
Contributor Author

ianmktu commented May 5, 2021

Yes, it still happens with the latest version.

In the for loop if it encounters manager.log first it breaks, as a result it doesn't reach the correct log file for the plot process.

@ianmktu
Copy link
Contributor Author

ianmktu commented May 5, 2021

See if I do print outs like below - removing the break so it views the entire list:

            print("\n-------")
            for index, file in enumerate(process.open_files()):                
                if '.mui' == file.path[-4:]:
                    continue
                if file.path[-4:] not in ['.log', '.txt']:
                    continue
                print(index, file)

                log_file_path = file.path
                logging.info(f'Found log file: {log_file_path}')
                # break       
            print("-------")

The result for an incorrect process is this:

-------
46 popenfile(path='C:\\Users\\Ian\\Desktop\\Plot Manager\\manager.log', fd=-1)
62 popenfile(path='C:\\Users\\Ian\\Desktop\\Plot Manager\\log\\evo_2021-05-05_09_07_47_812232.log', fd=-1)
-------

If the break is still there, the loop encounters manager.log first on the 46th index and uses that as the log_file_path instead of the correct path for the log in the 62nd index.

@swar
Copy link
Owner

swar commented May 9, 2021

Got it. Very good in-depth explanation as well!

@swar swar changed the base branch from main to development May 9, 2021 19:05
@swar swar merged commit a012d77 into swar:development May 9, 2021
@swar swar mentioned this pull request May 20, 2021
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