Logging

This patch adds logging setup. Setup function allows either automatic setup
according to project variables values or can be overriden by function parameters.