How to disable the INFO log?

I don’t want this log display in stdout:

INFO train_loop_utils.py:617 -- Data type <class 'int'> doesn't support being moved to device.

So I add this code:

    level = logging.WARNING
    logger = logging.getLogger("ray")
    logger.setLevel(level)
    stream_handler = logging.StreamHandler(sys.stdout)
    stream_handler.setLevel(level)
    logger.addHandler(stream_handler)

I test add this code before or after ray.init() , neither of them works.

I also tested ray.init(logging_level="warning"), which didn’t work either.

@Xinchengzelin Yes, we printout a lot of INFO messages.

cc: @Chen_Shen @chengsu Is there anyway to suppress and adhere to specified logging levels?

@Jules_Damji
Ray v2.6.3, Ray is creating hundreds of files under /tmp/ray/session_latest/logs/
I would like to understand how do I control the Event stats log printed by ray. Also I could see lot of noise in the logs due to RAY_LOG(INFO).

Mainly worker-*.err, worker-*.out and python-core-worker-*.logs.
How do I completely disable these logs ? and also stop ray from creating so many worker log files