private static void Print(string prefix, ILogger <Worker> logger, IMyService myService) { var values = myService.GetValues(); logger.LogInformation(prefix + string.Join(',', values)); logger.LogInformation(prefix + "IMyService instance hash code = {0}", myService.GetHashCode()); }