Custom logging method for printing logs with function & class name.