Skip to content

Conversation

Splines
Copy link
Member

@Splines Splines commented Oct 29, 2024

In #56, we introduced a new logging mechanism. Here, we make use of that to log many important steps in the program, mainly for the ManimShell and the code preview. Note that as described in the Readme, the default logging level is Info, so adding these debug or trace logging statements should not be a performance problem.

I've also added a custom Window class that we can use (note W instead of w). Before showing the actual notification to the user, it will also log its message with respective log levels.

@Splines Splines self-assigned this Oct 29, 2024
@Splines Splines marked this pull request as ready for review October 29, 2024 11:32
@VladimirFokow
Copy link
Collaborator

haha, these emojis😄

@Splines
Copy link
Member Author

Splines commented Oct 29, 2024

haha, yeah I like this a lot for debugging purposes as it helps me to visually filter the relevant statements. And the icons themselves are really not that important, just that they differ from one another.

@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 29, 2024

Is the old log file ever cleared?

I just reloaded the window,
opened the log file,
but all my old logs are still there..

(I thought the README says to reload the window - in order for the old logs to be removed?)

@Splines
Copy link
Member Author

Splines commented Oct 29, 2024

The log management is taken care of by VSCode itself. When you reload the window, the old log file will have the same content. However, VSCode creates a new folder in a temporary directory with a fresh new log file. Just use the Manim Notebook: Open Log File command again.

And yes, the Readme says to reload the window, such that VSCode is creating a new logfile for us.

@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 29, 2024

For me:
"Manim Notebook: Open Log File" still opens the SAME log file..
Even when you REstart the extension debugging session.

What makes it open the NEW log file:
STOPPING the extension debugging session. THEN starting it

@Splines
Copy link
Member Author

Splines commented Oct 29, 2024

So can you confirm the behavior is different than this? Note how the second log file resides in exthost17 and not exthost16 anymore (see the breadcrumbs).

manim-logfiles.mp4

@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 29, 2024

Yes, definitely different.

The same log file opens.

Here are these logs, you see the extension restarting:

2024-10-29 15:22:12.677 [info] [extension.js:65:21] [activate] Manim Notebook activated
2024-10-29 15:22:56.963 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:00.470 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:01.369 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:02.037 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:02.624 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:03.300 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:04.485 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:09.581 [info] [extension.ts:69:9] [unknown] 💠 Manim Notebook extension deactivated
2024-10-29 15:23:13.199 [info] [extension.js:65:21] [activate] Manim Notebook activated
2024-10-29 15:23:15.019 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File
2024-10-29 15:23:19.077 [info] [extension.ts:51:11] [unknown] 💠 Command requested: Open Log File

Looks like this is another MacOS-related issue for us with @bhoov ..

@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 29, 2024

This can be moved to an issue as a bug,
but this PR can be merged (if nobody knows how to solve this issue in this PR)

@Splines
Copy link
Member Author

Splines commented Oct 29, 2024

Yeah, as this PR is just adding simple log statements, fixes like these would be better suited for a subsequent one. Thanks for approving.

@Splines Splines merged commit afd8f98 into main Oct 29, 2024
@Splines Splines deleted the feature/log-statements branch October 29, 2024 14:32
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