In a large heavy pot, melt the butter over medium heat. Stir in the leeks, onions and shallots and toss to coat with the butter. Cook onions until they begin to soften. Cover and continue to stir occasionally. When the onions begin to turn golden, turn up the heat to medium high and add the pinch of sugar and nutmeg. Continue to cook until onions turn a rich golden brown. Season onions with salt and pepper. Add red wine and bring to a simmer. Cook for 3-5 minutes. Pour in warm stock and bring to a simmer. Preheat oven to 400 degrees. Ladle soup into ovenproof bowls and place bowls on baking sheet. Top each bowl with slice of bread and sprinkle with cheese. Bake for 15 minutes or until bubbly.