How to enable RAYLOG (DEBUG) when using bazel test locally?

I am currently using the command bazel test --cxxopt=-std=c++17 --test_output=all --experimental_ui_max_stdouterr_bytes=10485760 --cache_test_results=no //:xxx, and then tried to print the RAYLOG(DEBUG) related output that comes with RAY, but I couldn’t see it

I have read the official documentation, but after I set RAY_BACKEND_LOG_LEVEL to “DEBUG” in bazel’s env, I still couldn’t print the DEBUG level log

I used three methods:

  1. Add --test_env=RAY_BACKEND_LOG_LEVEL="DEBUG" in bazel test

  2. Add test --test_env=RAY_BACKEND_LOG_LEVEL="DEBUG" in .bazelrc

  3. Add env = {"RAY_BACKEND_LOG_LEVEL": "DEBUG",}, in BUILD.bazel

I really want to know how to correctly print the DEBUG log.

I have solved this problem: call the StartRayLog method of RayLog in the single test method and set the corresponding log level