How to inhibit weaviate embedded messages?

I am writing an exploratory program using connect_to_embedded()

In my program I have a few print statements to follow the logic but they are drowned amidst a deluge of messages such as the following:

{"action":"startup","default_vectorizer_module":"none","level":"info","msg":"the default vectorizer modules is set to \"none\", as a result all new schema classes without an explicit vectorizer setting, will use this vectorizer","time":"2024-05-21T09:12:06+02:00"}
{"action":"startup","auto_schema_enabled":true,"level":"info","msg":"auto schema enabled setting is set to \"true\"","time":"2024-05-21T09:12:06+02:00"}
{"level":"info","msg":"No resource limits set, weaviate will use all available memory and CPU. To limit resources, set LIMIT_RESOURCES=true","time":"2024-05-21T09:12:06+02:00"}
{"level":"warning","msg":"Multiple vector spaces are present, GraphQL Explore and REST API list objects endpoint module include params has been disabled as a result.","time":"2024-05-21T09:12:06+02:00"}
{"action":"grpc_startup","level":"info","msg":"grpc server listening at [::]:50050","time":"2024-05-21T09:12:06+02:00"}
{"action":"restapi_management","level":"info","msg":"Serving weaviate at http://127.0.0.1:8079","time":"2024-05-21T09:12:06+02:00"}

How to I control/filter them? Thank you

Hello @rjalex -

Thanks for your question, have you tried to pipe the system messages on STDERR to /dev/null or another file?

Hereโ€™s a link to the embedded docs: [link]

It looks like this:
python3 your_embedded_client_script.py 2>/dev/null

1 Like

I did this to reduce messages.

weaviate.connect_to_embedded(
...,
environment_variables={ "LOG_LEVEL": "error"}
)

You can also use a warnings context manager to wrap your code and suppress weaviate messages

import warnings
import weaviate

with warnings.catch_warnings():
    warnings.filterwarnings("ignore", module="weaviate")
    client = weaviate.connect_to_embedded(...
1 Like