Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The Output window and Debug console window of VSCode does not display output #8

Closed
Yimi81 opened this issue Jun 5, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@Yimi81
Copy link

Yimi81 commented Jun 5, 2023

Hi Nils,
When I run the code, the output is displayed normally in UE, but not in vscode. However, the screenshot you provided shows that yours is normal. May I ask where I went wrong?

abd2ac4b0e7cc8e89517873c6940f96

@Yimi81
Copy link
Author

Yimi81 commented Jun 5, 2023

Moreover, when I use "print" function, everything is normal

@nils-soderman
Copy link
Owner

Hi,

You are correct, seems like the logs functions aren't caught by VS Code.
Right now the extension reads the stdout, so I guess these functions aren't writing to it. Will have to make some workaround to make sure these log functions are caught as well.

Thanks for reporting this!

Cheers,
Nils

@nils-soderman nils-soderman added the enhancement New feature or request label Jun 7, 2023
@Andrej730
Copy link

Similar thing with the errors.

For example running the script:

from importlib import reload
import unreal

print('script is loaded.')

EAL = unreal.EditorAssetLibrary
items = EAL.list_assets('/All')

in VS Code:

script is loaded.

in Unreal:

LogEditorAssetSubsystem: Error: ListAssets failed: Could not enumerate assets in directory '/All'. Can't convert the path '/All' because it does not map to a root.
LogPython: script is loaded.

@Andrej730
Copy link

Andrej730 commented Jun 16, 2023

And with the code below it also gives completely empty output in VS Code:

from importlib import reload
import unreal

print('script is loaded.')

def list_asset_paths():
    EAL = unreal.EditorAssetLibrary
    items = EAL.list_assets('/Game')
    for item in items:
        print(item)

list_asset_paths()

Interestingly if you comment out the last line, you'll get "script is loaded.".

PS Wanted to say thank you for this feature, never thought I'd need it but turn out removing some extra steps to run code (alt+tab, reload python module, call module function...) is speeding up debugging process quite a bit and making it feel much better.

@nils-soderman nils-soderman added the bug Something isn't working label Jun 18, 2023
@nils-soderman
Copy link
Owner

Hi @Andrej730,

The first example is tricky, technically it's a LogEditorAssetSubsystem log, and not a python one, so this wouldn't be caught by the extension. One alternative might be to instead just read the .log file Unreal writes to catch everything logged during an execution, I would need to look closer into this to see what that would entail.

Your second example was a bug that occurred because the data Unreal was trying to send was too large and so it split it into 2 packages, which I hadn't accounted for. This will be fixed in the next update, thanks for reporting!

Cheers,
Nils

@nils-soderman
Copy link
Owner

Version 0.2.3 has now been released fixing the python log functions & too large outputs not showing up in the output channel.

@nils-soderman nils-soderman removed the bug Something isn't working label Jun 21, 2023
@nils-soderman
Copy link
Owner

Hi,

After some careful consideration and the re-write of the module communicating with Unreal Engine for the 1.0.0 release,
I've decided catching non-python logs is out of scope for this extension.

I'm going to close this issue for now, but if this is an issue that keeps coming up this might be revisited.

Thank you both for reporting these issues though!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants