diff --git a/.gitignore b/.gitignore index 0d8ac05d2..bacb55934 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ scaladex.log .metals/ **/project/metals.sbt .bsp/ +.vscode/ diff --git a/modules/server/src/main/scala/scaladex/server/route/ProjectPages.scala b/modules/server/src/main/scala/scaladex/server/route/ProjectPages.scala index 7861b2afc..c21a8e861 100644 --- a/modules/server/src/main/scala/scaladex/server/route/ProjectPages.scala +++ b/modules/server/src/main/scala/scaladex/server/route/ProjectPages.scala @@ -199,7 +199,9 @@ class ProjectPages(env: Env, database: WebDatabase, searchEngine: SearchEngine)( ) Future.successful(redirect(redirectUri, StatusCodes.MovedPermanently)) case Some(project) => f(project) - case None => Future.successful(complete(StatusCodes.NotFound, notfound(env, user))) + case None => + logger.warn(s"Project $ref not found") + Future.successful(complete(StatusCodes.NotFound, notfound(env, user))) } onSuccess(future)(identity) } @@ -248,6 +250,7 @@ class ProjectPages(env: Env, database: WebDatabase, searchEngine: SearchEngine)( private def getProjectPage(ref: Project.Reference, user: Option[UserState]): Route = getProjectOrRedirect(ref, user) { project => + logger.info(s"Accessing project page for: $ref") for { header <- getProjectHeader(project) directDependencies <- @@ -256,6 +259,7 @@ class ProjectPages(env: Env, database: WebDatabase, searchEngine: SearchEngine)( .getOrElse(Future.successful(Seq.empty)) reverseDependencies <- database.getProjectDependents(ref) } yield { + logger.info(s"Successfully retrieved project data for: $ref") val groupedDirectDependencies = directDependencies .groupBy(_.target) .view diff --git a/modules/webclient/src/main/scala/scaladex/client/ActiveNavObserver.scala b/modules/webclient/src/main/scala/scaladex/client/ActiveNavObserver.scala index 4d49fa00c..fd7b1baa3 100644 --- a/modules/webclient/src/main/scala/scaladex/client/ActiveNavObserver.scala +++ b/modules/webclient/src/main/scala/scaladex/client/ActiveNavObserver.scala @@ -30,8 +30,13 @@ object ActiveNavObserver { // ignore the observed entry and update all sections instead debounceUpdate = timers.setTimeout(150) { for ((section, navItem) <- sectionsAndNavItem) - if (isInViewport(section)) navItem.classList.add("active") - else navItem.classList.remove("active") + if (isInViewport(section)) { + navItem.classList.add("active") + println(s"Section ${section.getAttribute("id")} is in viewport") + } else { + navItem.classList.remove("active") + println(s"Section ${section.getAttribute("id")} is out of viewport") + } } } diff --git a/project/Docker.scala b/project/Docker.scala index 57dc1e7cd..5284d57ee 100644 --- a/project/Docker.scala +++ b/project/Docker.scala @@ -10,6 +10,8 @@ object Docker { def kill(containerId: String): Unit = try client.killContainerCmd(containerId).exec() catch { - case _: Throwable => () + case e: Throwable => + // Log the error + println(s"Error killing container $containerId: ${e.getMessage}") } } diff --git a/project/Elasticsearch.scala b/project/Elasticsearch.scala index 51ca9ef76..4c9fa775a 100644 --- a/project/Elasticsearch.scala +++ b/project/Elasticsearch.scala @@ -81,6 +81,7 @@ object Elasticsearch extends AutoPlugin { container.getFirstMappedPort() } catch { case e: Throwable => + logger.error(s"Error starting Elasticsearch container: {$e}") container.stop() throw e } diff --git a/project/Postgres.scala b/project/Postgres.scala index 54773ee3e..0ffbc8d0e 100644 --- a/project/Postgres.scala +++ b/project/Postgres.scala @@ -92,6 +92,7 @@ object Postgres extends AutoPlugin { container.getFirstMappedPort() } catch { case e: Throwable => + logger.error(s"Error starting PostgreSQL container: {$e}") container.close() throw e }