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

Tweak output information in Log File #75

Closed
IAmVigneswaran opened this issue Dec 3, 2023 · 17 comments
Closed

Tweak output information in Log File #75

IAmVigneswaran opened this issue Dec 3, 2023 · 17 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@IAmVigneswaran
Copy link
Contributor

Could we print and state the current version of MarkersExtractor in the Log file before starting the operation?

@IAmVigneswaran IAmVigneswaran added the enhancement New feature or request label Dec 3, 2023
@IAmVigneswaran IAmVigneswaran added this to the 0.3.0 milestone Dec 3, 2023
@orchetect
Copy link
Contributor

Could do, yes.

You can also do it yourself by piping the output of markers-extractor-cli -v to the log first.

While on this point, it could be a good idea to include the version in the result json file.

@IAmVigneswaran
Copy link
Contributor Author

This feature could be particularly useful for our Marker Data app for debugging.

If Marker Data have several release down the line, when users encounters a bug or issue, it might be easier to trace?

The user might not be on the latest version of Marker Data.

@orchetect
Copy link
Contributor

That sounds more like you want to log Marker Data version. It's more likely that the same version of MarkersExtractor would be used with more than one release of Marker Data. So logging MarkersExtractor's version alone would only help for debugging extraction. It wouldn't really help for debugging Marker Data.

@IAmVigneswaran
Copy link
Contributor Author

IAmVigneswaran commented Dec 3, 2023

It's more likely that the same version of MarkersExtractor would be used with more than one release of Marker Data.

True.

So logging MarkersExtractor's version alone would only help for debugging extraction. It wouldn't really help for debugging Marker Data.

Yes. We can have 2 log file. One for extraction and one for Marker Data's program log.

The idea is

/Users/UserID/Library/Application Support/Marker Data/Logs/csv2notion-neo_log.txt
/Users/UserID/Library/Application Support/Marker Data/Logs/airlift_log.txt
/Users/UserID/Library/Application Support/Marker Data/Logs/markerdata_log.txt
/Users/UserID/Library/Application Support/Marker Data/Logs/MarkersExtractor_log.txt

Would it make sense?

@orchetect
Copy link
Contributor

Yeah, whatever works for you.

I can add the version to the CLI log output and a key to the result json file.

@IAmVigneswaran
Copy link
Contributor Author

Thank you!

@orchetect
Copy link
Contributor

Version output to both log and result file is done. Will be in 0.2.9.

@IAmVigneswaran
Copy link
Contributor Author

Will close this for now.

@orchetect orchetect self-assigned this Dec 16, 2023
@IAmVigneswaran
Copy link
Contributor Author

When I try and use -v, I get an error.

Error: Unknown option '-v'

@IAmVigneswaran
Copy link
Contributor Author

The version is shown in the terminal but it is not printed in the log file.

Also are we able to print exactly like in the terminal into the log file?

MarkersExtractor 0.3.0
Using Notion export profile.
Parsing XML from "XYZ"
Note that this may take several seconds for very large projects. Please wait...
Extracting Markers...
5%
10%
15%
Project start timecode: 00:00:00:00 @ 25 fps.
Found project media file: "XYZ".
Generating PNG thumbnail images into "XYZ".
Generating metadata file(s) into "XYZ".
20%
Exporting marker icons...
24%
Generating PNG images for markers...
.
.
.

@IAmVigneswaran IAmVigneswaran modified the milestones: 0.2.9, 0.3.1 Dec 17, 2023
@IAmVigneswaran IAmVigneswaran changed the title Print MarkersExtractor version number in Log File Tweak output information in Log File Dec 17, 2023
@IAmVigneswaran IAmVigneswaran modified the milestones: 0.3.1, 0.3.2 Jan 1, 2024
@orchetect
Copy link
Contributor

When I try and use -v, I get an error.

Sorry, I thought the argument parser had both -v and --version but now that I check, it's just --version.

@IAmVigneswaran
Copy link
Contributor Author

I have just tested this 0.3.2

But for some reason, the full terminal is not printed into the log file.

I am using --log-level debug --log $ERROR_LOG.

This is what I get in the log file.

2024-01-04 17:56:40 info: 5%
2024-01-04 17:56:40 info: 10%
2024-01-04 17:56:40 info: 15%
2024-01-04 17:56:40 info: 20%
2024-01-04 17:56:40 info: 24%
2024-01-04 17:56:40 info: 27%
2024-01-04 17:56:40 info: 31%
2024-01-04 17:56:40 info: 34%
2024-01-04 17:56:40 info: 37%
2024-01-04 17:56:40 info: 40%
2024-01-04 17:56:40 info: 44%
2024-01-04 17:56:40 info: 47%
2024-01-04 17:56:40 info: 50%
2024-01-04 17:56:40 info: 53%
2024-01-04 17:56:40 info: 57%
2024-01-04 17:56:40 info: 60%
2024-01-04 17:56:40 info: 63%
2024-01-04 17:56:40 info: 67%
2024-01-04 17:56:40 info: 70%
2024-01-04 17:56:40 info: 73%
2024-01-04 17:56:40 info: 76%
2024-01-04 17:56:40 info: 80%
2024-01-04 17:56:40 info: 83%
2024-01-04 17:56:40 info: 86%
2024-01-04 17:56:40 info: 89%
2024-01-04 17:56:40 info: 93%
2024-01-04 17:56:40 info: 96%
2024-01-04 17:56:40 info: 100%
ata Demo_V1 2024-01-04 05-56-40".
2024-01-04 17:56:40 info: Exporting marker icons...
2024-01-04 17:56:40 info: Generating PNG images for markers...
2024-01-04 17:56:40 info: Creating result file "/Users/XX/Desktop/Marker_Data/App/CLI/result.json".
2024-01-04 17:56:40 info: Done

@IAmVigneswaran IAmVigneswaran modified the milestones: 0.3.2, 0.3.3 Jan 6, 2024
@IAmVigneswaran IAmVigneswaran added the bug Something isn't working label Jan 6, 2024
@orchetect
Copy link
Contributor

orchetect commented Jan 7, 2024

It works fine when --no-progress is present.

Progress reporting to the log file is being called from a background thread I believe, which may be corrupting the log output.

A simple solution may be to just omit progress percentage output from the log file. It's not really useful and adds extra noise to the log.

@IAmVigneswaran
Copy link
Contributor Author

It works fine when --no-progress is present.

Progress reporting to the log file is being called from a background thread I believe, which may be corrupting the log output.

Will using --no-progress affect's Marker Data's ability in reading MarkersExtractor progress percentage?

A simple solution may be to just omit progress percentage output from the log file. It's not really useful and adds extra noise to the log.

Let's omit progress reporting in the log file in the next build? We can also remove --no-progress flag.

@orchetect
Copy link
Contributor

Progress in console, progress in log file, and progress reporting in GUI are 3 different unrelated concepts.

Progress will remain in console but be omitted from log file. GUI progress has nothing to do with this.

@orchetect
Copy link
Contributor

orchetect commented Jan 7, 2024

I discovered why the log was getting corrupted. Mistakenly, the log file was being opened for writing twice - once by the extractor, and once by the progress reporter. That's now resolved.

  • Console will continue to show progress (or hide it if --no-progress is passed) which is the same as before.
  • Now, progress will always be omitted from the log file. --no-progress obviously has no effect there.
  • GUI progress is unrelated. Nothing was broken with it, and thus nothing has changed.

Will be in 0.3.3.

Console output:

MarkersExtractor 0.3.2
Using CSV export profile.
Parsing XML from "/Users/stef/Dropbox/_coding/MarkersExtractor/GitHub Issues/Issue 37/SAM-BRS-TEST/BRS_LOCKED6_20210521 - 01 Opening Scene.fcpxmld/Info.fcpxml"
Note that this may take several seconds for very large projects. Please wait...
Extracting Markers...
5%
10%
15%
Project start timecode: 00:59:50:00.00 @ 25 fps.
Bypassing media file.
Generating metadata file(s) into "/Users/stef/Desktop/me-cli-output/BRS_LOCKED6_20210521 - 01 Opening Scene 2024-01-06 06-47-44 [CSV]".
20%
Exporting marker icons...
24%
96%
Creating result file "/Users/stef/Desktop/me-cli-output/result.json".
100%
Done

Log file output:

2024-01-06 18:47:42 info: MarkersExtractor 0.3.2
2024-01-06 18:47:42 info: Using CSV export profile.
2024-01-06 18:47:42 info: Parsing XML from "/Users/stef/Dropbox/_coding/MarkersExtractor/GitHub Issues/Issue 37/SAM-BRS-TEST/BRS_LOCKED6_20210521 - 01 Opening Scene.fcpxmld/Info.fcpxml"
2024-01-06 18:47:42 info: Note that this may take several seconds for very large projects. Please wait...
2024-01-06 18:47:43 info: Extracting Markers...
2024-01-06 18:47:44 info: Project start timecode: 00:59:50:00.00 @ 25 fps.
2024-01-06 18:47:44 info: Bypassing media file.
2024-01-06 18:47:44 info: Generating metadata file(s) into "/Users/stef/Desktop/me-cli-output/BRS_LOCKED6_20210521 - 01 Opening Scene 2024-01-06 06-47-44 [CSV]".
2024-01-06 18:47:44 info: Exporting marker icons...
2024-01-06 18:47:44 info: Creating result file "/Users/stef/Desktop/me-cli-output/result.json".
2024-01-06 18:47:44 info: Done

@IAmVigneswaran
Copy link
Contributor Author

Thank you!

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

No branches or pull requests

2 participants