Now people now where did I copied it from!
This commit replaces the old rudimentary log handler by a shinier version of it. It also introduces the debugging macros that I usually add to the apps, including the CC_TRACE_MSG() macro for tracing.