#include std::ostringstream log; DWORD log_context = 0, log_module_id = 0; struct log_command { int value; log_command(int _value) : value(_value) { } }; const log_command FLUSH_ERROR(1), FLUSH_NORMAL(0), FLUSH_SPECIAL(2); std::ostream &operator <<(std::ostream &o, log_command cmd) { console_message(log_context, log_module_id, (DWORD)log.str().c_str(), cmd.value); log.str(""); return o; } /* This little snippet of code will make your life quite a bit easier. It allows you to use a stream to send console messages to laserjesus. Just insert this at the beginning of the file you want to use it in, and remember to set log_context = context; log_module_id = module_id; in the event_initialize function so that this all works correctly. Just do log << "A string message" << a_variable << "etc..." << FLUSH_NORMAL. The only thing different from regular stream syntax is that FLUSH_NORMAL thing at the end. FLUSH_NORMAL just sends the contents of the log to laserjesus. FLUSH_NORMAL will do black text, while FLUSH_ERROR will do red text and FLUSH_SPECIAL will do blue text: log << "Blue..." << FLUSH_SPECIAL << "...red..." << FLUSH_ERROR << "...and black!" << FLUSH_NORMAL; Just remember that you don't need to insert a newline at the end -- console_message does that for you. */