An object reference is required to access non-static member

so i have this coroutine i want to start. but the fucntion i start it from has to be static.

and then it throws me this error. What is the right way to fix this?

heres my code:

public class remoteDebug : MonoBehaviour {
	static string Debug_URL = "http://www.url.com/submitDebug.php";


		public static void log (string text)
		{
			StartCoroutine(handleLog(text));
		}

	 static IEnumerator handleLog(string info)
	{
		string send_url = Debug_URL + "info=" + info;
		WWW loginReader = new WWW(send_url);
		yield return loginReader;
		
		Debug.Log (loginReader.text);
		
		if (loginReader.error != null)
		{
			//good 
		}
		else
		{
			//bad
		}
		
	}
	
}

Static coroutines doesn’t work out of the box in Unity. This is because coroutines are essentially an extra piece of code attached to a script component, and needs that script component to be called again after a yield has returned.

To solve this, you have some options:

1: make the remoteDebug a singleton monoBehaviour, and attach the coroutines to it.

2: Implement static coroutines.

3: Work around it by regularly polling a bool variable to check if the static method you’re waiting for is finished.