Can you tell me what I am doing wrong in this editor script?

I am trying to create a tool for my artists to allow them to instance objects with a raycast in either the scene view editor window-‘preferrably’ or the game view editor window.

I have created a Editor folder in my project and my current script is located in it and I am familiar with the Windows editor features but I am unable to get a raycast or a simple log out in this script:

using UnityEngine;
using System.Collections;
using UnityEditor;

class RaycastingOUt : Editor
{
    public void OnSceneGUI ()
    {
        if (Event.current.type == EventType.mouseMove)
        {
            Debug.Log("A simple test debug");
            Physics.Raycast(HandleUtility.GUIPointToWorldRay(Event.current.mousePosition));
        }
    }
}

Could you give me some advice on what I am doing wrong?

Thanks,

Based on your reply to my comment I wrote this for you:
using UnityEngine;
using UnityEditor;
using System.Collections;

public class ObjectPlacer : EditorWindow {
	public GameObject prefab;

	[MenuItem ("Window/Object Placer")]
	static void Init () {
		ObjectPlacer window = (ObjectPlacer)EditorWindow.GetWindow (typeof (ObjectPlacer));
		window.Show();
	}

	void OnGUI() {
		prefab = EditorGUILayout.ObjectField ("Prefab", prefab, typeof(GameObject), true) as GameObject;
	}

	// Setup to be called by OnFocus and OnDestroy
	void OnSceneGUI(SceneView sceneView) {
		if (!prefab)
			return;
		
		if (Event.current.type == EventType.mouseDown) {
			RaycastHit hit;
			bool didHitSomething = Physics.Raycast(HandleUtility.GUIPointToWorldRay(Event.current.mousePosition), out hit);

			if (didHitSomething) {
				GameObject instance = Instantiate (prefab) as GameObject;
				instance.transform.position = hit.point;
				Undo.RegisterCreatedObjectUndo (instance, "Undo Instantiate " + prefab.name);
			}
		}
	}

	void OnFocus() {
		// Add or readd delegate
		SceneView.onSceneGUIDelegate -= OnSceneGUI;
		SceneView.onSceneGUIDelegate += OnSceneGUI;
	}

	void OnDestroy() {
		SceneView.onSceneGUIDelegate -= OnSceneGUI;
	}
}

I tested and I can click and place a Cube prefab I made all over a scene. It’s kind of therapeutic.