class_docstr: A filter that adds ray context info to log records.
  
  This filter adds a package name to append to the message as well as information
  about what worker emitted the message, if applicable.
docstr: Add context information to the log record.
  
  This filter adds a package name from where the message was generated as
  well as the worker IP address, if applicable.
  
  Args:
      record: Record to be filtered
  
  Returns:
      True if the record is to be logged, False otherwise. (This filter only
      adds context, so records are always logged.)
docstr_tok: ["Add","context","information","to","the","log","record",".","This","filter","adds","a","package","name","from","where","the","message","was","generated","as","well","as","the","worker","IP","address",",","if","applicable",".","Args",":","record",":","Record","to","be","filtered","Returns",":","True","if","the","record","is","to","be","logged",",","False","otherwise",".","(","This","filter","only","adds","context",",","so","records","are","always","logged",".",")"]
code: def filter(self, record: logging.LogRecord) -> bool:
      """Add context information to the log record.
  
      This filter adds a package name from where the message was generated as
      well as the worker IP address, if applicable.
  
      Args:
          record: Record to be filtered
  
      Returns:
          True if the record is to be logged, False otherwise. (This filter only
          adds context, so records are always logged.)
      """
      match = self.logger_regex.search(record.name)
      if match and match["subpackage"] in self.package_message_names:
          record.package = (
              f"[Ray {self.package_message_names[match['subpackage']]}]"
          )
      else:
          record.package = ""
  
      return True
  
file_path: ray/python/ray/_private/log.py
imports: import logging
  import re
  from logging.config import dictConfig
  import threading
  from typing import Union
label_desc: Use image node_id 2 for calling the ContextFilter obj's underlying member method code with example usage: obj.filter(record) and returns: True