Unified logging function

Should be easily customizable. If you don't want it, no problem, I just thought it would make things easier than always checking for debug and what not :)