Brown hamburger and onion. Drain. In a large saucepan, add the hamburger, onions, sauce, mushrooms, sugar, basil and salt. Cover and simmer about 10 minutes. Meantime, cook spaghetti until tender and drain well.
Mix the hamburger mixture together with the spaghetti, and put in medium size casserole, or cake pan. Cover and bake 30-40 minutes @ 350 degree oven until bubbly. Uncover, sprinkle with cheese and return to the oven and bake about 5 minutes longer.