decorator for logging