code: def add_log_callback(callback):
      
      global _log_callbacks
  
      if not callable(callback):
          raise ValueError("Callback must be callable")
  
      _log_callbacks.add(callback)
      return callback
docs: Adds a log callback.