How do I print something to the console when using the game engine?
You need to import GameLogic before you can use it, print statement has been replaced by a function in python3 print( arg ).
This works:
import bge
import GameLogic
cont = GameLogic.getCurrentController()
print(dir(cont))

or alternatively
cont = bge.logic.getCurrentController() # bge.logic is automatically imported
print(dir(cont))

Note that the script wouldn't work in the python console (Editor Type) only when wired in the logic editor.

The output goes to console opened via main menu: Window / Toggle System Console
Related:

Is it possible to dump an Objects Properties and Methods?