I’m working on migrating my tests to use `build_so...
# ask-community
c
I’m working on migrating my tests to use
build_solid_context
with direct invocation instead of
execute_solid
but I’m running into some inconsistent behavior with configuring the logger. With
execute_solid
I was able to pass this with the config to suppress the DEBUG level being output to console:
Copy code
{'loggers': {'console': {'config': {'log_level': 'INFO'}}}}
But when I directly invoke the solid with
Copy code
context = build_solid_context(config={'loggers': {'console': {'config': {'log_level': 'INFO'}}}})
some_solid(context)
The DEBUG level is still being output to the console, is there anyway to suppress that?
o
hi @Cameron Gallivan! thanks for pointing this out, this seems to be an oversight. I've filed a ticket (https://github.com/dagster-io/dagster/issues/4660), but unfortunately it doesn't seem like there's an easy way around this until this gets fixed. just for more context, are these extra log messages a hard blocker for parts of your tests, or is it more of an annoyance?
c
It’s just a nuisance for log spam during the test runs, I didn’t know if I was missing something using the new method. I see that the instance used for build_solid_context is controllable but I didn’t see how to control the logging in DagsterInstance.ephemeral() directly and I didn’t want to setup another yaml file for just tests.
o
makes sense -- there are a few moving pieces in the logging world at the moment, but I believe we should have a change ready for next release that would allow you to set the log level for the entire instance. That would look something like
build_solid_context(instance=DagsterInstance.local_temp(overrides={"python_logs":{"python_log_level":"INFO"}}))
. However, that's a bit more heavy-handed than using an ephemeral DagsterInstance, so ideally we'd make a change to actually respect the run config.