https://dagster.io/ logo
#ask-community
Title
# ask-community
n

Nelson De menezes

08/24/2023, 4:14 AM
image.png
j

jamie

08/24/2023, 2:02 PM
using
print
in an asset will print to the terminal - if you want logs to appear in the dagster logs (ie in the UI) you want to use the dagster logger which is accessed through the dagster provided context
Copy code
@asset 
def test(context):
    <http://context.log.info|context.log.info>("hello world")
a

alex

08/24/2023, 2:50 PM
the raw terminal output should be visible in the “raw compute logs” section
n

Nelson De menezes

08/24/2023, 2:57 PM
image.png,image.png
UserWarning: WARNING: Compute log capture is disabled for the current environment. Set the environment variable
PYTHONLEGACYWINDOWSSTDIO
to enable.
maybe this error?
a

alex

08/24/2023, 2:58 PM
yep that would explain it
n

Nelson De menezes

08/24/2023, 2:59 PM
do you know how i set this environment variable?
a

alex

08/24/2023, 3:01 PM
export PYTHONLEGACYWINDOWSSTDIO=1
in bash, what terminal are you using?
n

Nelson De menezes

08/24/2023, 3:01 PM
shell
pycharm shell
n

Nelson De menezes

08/24/2023, 3:07 PM
image.png
image.png
image.png
still not worked
😢
a

alex

08/24/2023, 3:11 PM
is the shell you are running
dagster dev
in using that
compute_logs
run/debug configuration ? did you try
export PYTHONLEGACYWINDOWSSTDIO=1
before running
dagster dev
?
n

Nelson De menezes

08/24/2023, 3:12 PM
yes
image.png
a

alex

08/24/2023, 3:14 PM
ok thats powershell,
$env:PYTHONLEGACYWINDOWSSTDIO = '1'
maybe
❤️ 1
🌈 1
D 1
n

Nelson De menezes

08/24/2023, 3:16 PM
😄
workedddd
i've to run this every time i run dagster run?
a

alex

08/24/2023, 4:04 PM
you can search on line for ways to manage how its set / how to persist the value