Duncan
08/18/2022, 1:00 PM@graph
) in an exception case, and as such I’d like to disable dagster’s logging as it makes a mess of the test’s logging output. However, calling getLogger('dagster').setLevel(…
before the test does not seem to work - checking the logger after the test shows that it’s been force-reset in the interim. How can one actually disable the logging for the duration of a text execution?sandy
08/18/2022, 3:43 PMowen
08/18/2022, 4:39 PMdagster.builtin
, just not dagster
):
import logging
from dagster import op, get_dagster_logger, build_op_context
@op
def foo(context):
get_dagster_logger().debug("hi")
return 1
def test_foo():
dagster_logger = logging.getLogger("dagster.builtin")
dagster_logger.setLevel("ERROR")
foo(build_op_context())
assert False
Duncan
08/19/2022, 10:12 AM