Skip to content

Conversation

Splines
Copy link
Member

@Splines Splines commented Oct 29, 2024

In this PR, we init the Logger class to log to the Manim Notebook output pane in VSCode as well as to a dedicated log file. For users to access this log file, we add a Manim Notebook: Open log file command. I've also included a section in the Readme explaining how to report an issue using this log file.

As I had to search way too long to find the relevant information on how to log in a VSCode extension, I've also written a StackOverflow answer.

A subsequent PR will then add respective Logger.trace() etc. statements at important places in the code.

Known limitations

The line and colon numbers refer to the position in the transpiled .js. I haven't yet bothered about generating source maps via the TypeScript compiler to then map the positions to those in the original .ts file. I don't even know if these maps would get distributed on the VSCode marketplace.

We can still (later on) write a small script for ourselves that takes in a given user log and the Manim Notebook version used, then checks out the respective code on GitHub, generates the source maps and replaces the corresponding line and colon numbers in the log file.

@Splines Splines self-assigned this Oct 29, 2024
@Splines Splines changed the title Init logger mechanism Init logging mechanism Oct 29, 2024
@Splines Splines marked this pull request as ready for review October 29, 2024 01:53
@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 29, 2024

  • I added the macos option name

  • Should we add the last step to README - something like this? @Splines , you decide if it's needed:

- You can then reset the logger level to default: `Developer: Set Log Level...` -> `Manim Notebook` -> `Info`

@Splines
Copy link
Member Author

Splines commented Oct 29, 2024

Thanks @VladimirFokow, that's a good idea, otherwise users might complain about performance. I've also updated the Regex to match another case, see the docstrings. And include the line number.

As approvals don't get dismissed when adding new commits (due to repo settings): do you still approve?

@VladimirFokow
Copy link
Collaborator

yes

@Splines Splines merged commit 9d6027e into main Oct 29, 2024
@Splines Splines deleted the feature/logging branch October 29, 2024 10:41
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