Hi folks! How can I pass logger from `InitResourc...
# ask-community
i
Hi folks! How can I pass logger from
InitResourceContext
into
ConfigurableResource
subclass? I found
ConfigurableResourceFactory
should have
create_resource()
method with context arg where I can get logger from, but it is kinda unclear for me how to do it with "plain"
ConfigurableResource
.
o
Hi @Ivan Tsarev! there's not a direct way to do this, but for most cases,
from dagster import get_dagster_logger
should let you get access to a logger that will work similarly to
context.log
(
get_dagster_logger().info("hi")
)
s
get_resource_context
is available as a method of
ConfigurableResourceFactory
🌈 2