From dad031b46eb2c25a0b82a433867119f68b096020 Mon Sep 17 00:00:00 2001 From: Siddharth Banga <91724657+VOSID8@users.noreply.github.com> Date: Tue, 2 Apr 2024 03:53:09 +0530 Subject: [PATCH] Added few loggers --- .gitignore | 2 +- .../main/scala/scaladex/server/route/ProjectPages.scala | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 59e31491c..bacb55934 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ scaladex.log .metals/ **/project/metals.sbt .bsp/ -.vscode +.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..5fb8c31cf 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,10 @@ 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 +251,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 +260,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