From 465711f183b8ea10306a150e3ef4701e7a231eef Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Tue, 22 Aug 2023 19:06:20 +0100 Subject: [PATCH] Only log at debug levels # Motivation Libraries shouldn't log above debug levels. --- Sources/ServiceLifecycle/ServiceGroup.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/ServiceLifecycle/ServiceGroup.swift b/Sources/ServiceLifecycle/ServiceGroup.swift index 119c468..67e3888 100644 --- a/Sources/ServiceLifecycle/ServiceGroup.swift +++ b/Sources/ServiceLifecycle/ServiceGroup.swift @@ -264,7 +264,7 @@ public actor ServiceGroup: Sendable { switch service.successTerminationBehavior.behavior { case .cancelGroup: - self.logger.error( + self.logger.debug( "Service finished unexpectedly. Cancelling group.", metadata: [ self.loggingConfiguration.keys.serviceKey: "\(service.service)", @@ -274,7 +274,7 @@ public actor ServiceGroup: Sendable { return .failure(ServiceGroupError.serviceFinishedUnexpectedly()) case .gracefullyShutdownGroup: - self.logger.error( + self.logger.debug( "Service finished. Gracefully shutting down group.", metadata: [ self.loggingConfiguration.keys.serviceKey: "\(service.service)", @@ -312,7 +312,7 @@ public actor ServiceGroup: Sendable { case .serviceThrew(let service, let index, let error): switch service.failureTerminationBehavior.behavior { case .cancelGroup: - self.logger.error( + self.logger.debug( "Service threw error. Cancelling group.", metadata: [ self.loggingConfiguration.keys.serviceKey: "\(service.service)", @@ -323,7 +323,7 @@ public actor ServiceGroup: Sendable { return .failure(error) case .gracefullyShutdownGroup: - self.logger.error( + self.logger.debug( "Service threw error. Shutting down group.", metadata: [ self.loggingConfiguration.keys.serviceKey: "\(service.service)", @@ -489,7 +489,7 @@ public actor ServiceGroup: Sendable { case .serviceThrew(let service, _, let error): switch service.failureTerminationBehavior.behavior { case .cancelGroup: - self.logger.error( + self.logger.debug( "Service threw error during graceful shutdown. Cancelling group.", metadata: [ self.loggingConfiguration.keys.serviceKey: "\(service.service)",