Simplifying logging function