i am having a weird issue. All of a sudden i am ge...
# ask-community
k
i am having a weird issue. All of a sudden i am getting “NameError: name ‘get_run_logger’ is not defined” in all my flow runs. Was working fine yesterday.
Copy code
from prefect import flow, task, get_run_logger

...

@task(tags=["feather"])
def feather_get_stuff():
    get_run_logger().info(f"test msg")
    return []
1
j
hey, is it just
get_run_logger
? Can you run flows fine w/o it?
k
yeah everything up to that point runs fine…
Copy code
15:09:36.386 | INFO    | Flow run 'sincere-coot' - Created subflow run 'tunneling-platypus' for flow 'map-fmp-cot-report'
15:09:36.388 | INFO    | Flow run 'tunneling-platypus' - View at <http://127.0.0.1:4200/flow-runs/flow-run/cc147a85-dd61-468e-ba3c-0618b6d82633>
15:09:36.476 | INFO    | Flow run 'tunneling-platypus' - Created task run 'feather_get_tickers_cot-0' for task 'feather_get_tickers_cot'
15:09:36.478 | INFO    | Flow run 'tunneling-platypus' - Executing 'feather_get_tickers_cot-0' immediately...
15:09:36.557 | ERROR   | Task run 'feather_get_tickers_cot-0' - Encountered exception during execution:
get_run_logger().info(f"GET feather file: {filepath}")
NameError: name 'get_run_logger' is not defined
j
what happens when you do just:
Copy code
from prefect import get_run_logger
get_run_logger()
what about:
Copy code
from prefect.logging import get_run_logger
get_run_logger()
you might have a naming or import conflict somewhere?
k
weird it was working yesterday in both my scripts. i didnt change the other one and it isnt working either.
looks like it does print/log one higher up the flow. not sure why it stopped working lower down the flow. i’ll mess with it. both your examples yield same result.
i think i figured it out. the culprit was a get_run_logger() i had put in a bad place. inside the feather resource. which is in my other scripts too.
🙌 1