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

Logger doesnt work as expected with VSCode Blender Addon #215

Open
windowslucker1121 opened this issue Dec 11, 2024 · 3 comments
Open

Logger doesnt work as expected with VSCode Blender Addon #215

windowslucker1121 opened this issue Dec 11, 2024 · 3 comments

Comments

@windowslucker1121
Copy link

windowslucker1121 commented Dec 11, 2024

Hey folks,

this may sound like a dump question (forgive me im relativly new to python) but struggling with this one for a while now and now seeking for someone to help:

When my logger is configured like this in my init.py:

import logging
import sys

# Configure logging
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
logging.basicConfig(
    level=logging.DEBUG,
    format=log_format,
    handlers=[
        logging.StreamHandler(sys.stdout),
        logging.StreamHandler(sys.stderr),
        logging.FileHandler("app.log")
    ]
)

# Example logger usage
logger = logging.getLogger("example")
logger.info("This is an info message")
logger.error("This is an error message")

The whole logs appear as expected inside the "Terminal" Window but not the "Debug Console" in VS Code.
Only print() commands are output to the "Debug Console".

Is this the intended behaviour? How do i redirect my logger output to the "Debug Console" (Its easier to read in my eyes)?

Thanks in advance!

@Mateusz-Grzelinski
Copy link
Collaborator

Mateusz-Grzelinski commented Dec 11, 2024

I think this is expected.
I got the same result in #198

And yes, this is confusing...
The blender is started as task and its put belongs to terminal.
The debugger (debugpy) is started as debug session therefore it's output is in debug window, it connects to previously started blender instance.
Did I mention output window? It has the things that developer of extension (me?) decided to log using vscode API.

@Mateusz-Grzelinski
Copy link
Collaborator

So I do not know why it happens this way but I also experienced it

@windowslucker1121
Copy link
Author

Okay, good - then its not a error made byme. Feels good to know.
Thanks for clarification!

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

No branches or pull requests

2 participants