Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back integration check logging after integration checks were moved to core #1882

Open
neko-kai opened this issue Jan 27, 2023 · 0 comments

Comments

@neko-kai
Copy link
Member

We want to have some informative logging surrounding integration checks - when they start and when they unexpectedly throw an exception:

  // PlanInterpreterNonSequentialImpl.scala
  val logger: IzLogger = ???

  private[this] def checkOrFail[F[_]: TagK](key: DIKey, resource: Any)(implicit F: QuasiIO[F]): F[Option[IntegrationCheckFailure]] = {
    F.suspendF {
      logger.debug(s"Checking $resource")
      resource
        .asInstanceOf[IntegrationCheck[F]]
        .resourcesAvailable()
        .flatMap {
          case ResourceCheck.Success() =>
            F.pure(None)
          case failure: ResourceCheck.Failure =>
            F.pure(Some(IntegrationCheckFailure(key, new IntegrationCheckException(NonEmptyList(failure)))))
        }
        .guaranteeOnFailure {
          exception =>
            F.maybeSuspend {
              logger.crit(s"""Integration check for $resource threw unexpected $exception.
                             |Integration checks shouldn't throw, but should return `ResourceCheck.Failure`,
                             |considering this exception a critical failure and Aborting!""".stripMargin)
            }
        }
    }
  }

But the problem is that we don't have accesss to logstage IzLogger in distage-core – before when integration checks were implemented in distage-framework we did have access to IzLogger there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant