From 1817109ef8ebe583b3d788a2c08a8a698a0f9607 Mon Sep 17 00:00:00 2001 From: Markus Lottmann Date: Thu, 24 Jul 2025 12:07:28 +0200 Subject: [PATCH 1/2] Only log about graph closing if it is not a zero operation. For graphs which have no storage backend, `close` just not do enough worth logging. --- core/src/main/scala/flatgraph/Graph.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/flatgraph/Graph.scala b/core/src/main/scala/flatgraph/Graph.scala index 57ab490e..aabb80c9 100644 --- a/core/src/main/scala/flatgraph/Graph.scala +++ b/core/src/main/scala/flatgraph/Graph.scala @@ -153,15 +153,16 @@ class Graph(val schema: Schema, val storagePathMaybe: Option[Path] = None) exten def isClosed: Boolean = closed override def close(): Unit = { - logger.debug("closing graph") this.closed = true for { storagePath <- storagePathMaybe if hasChangedSinceOpen - } Serialization.writeGraph(this, storagePath) - - logger.info("closed graph") + } { + logger.debug(s"closing graph: start writing changes to $storagePathMaybe") + Serialization.writeGraph(this, storagePath) + logger.info(s"closed graph at $storagePath}") + } } override def toString(): String = From b78af5532f466287e4c42d65b30e0a59a422bf64 Mon Sep 17 00:00:00 2001 From: Markus Lottmann Date: Fri, 25 Jul 2025 07:04:06 +0200 Subject: [PATCH 2/2] Update core/src/main/scala/flatgraph/Graph.scala Co-authored-by: Michael Pollmeier --- core/src/main/scala/flatgraph/Graph.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/flatgraph/Graph.scala b/core/src/main/scala/flatgraph/Graph.scala index aabb80c9..2cd3bb47 100644 --- a/core/src/main/scala/flatgraph/Graph.scala +++ b/core/src/main/scala/flatgraph/Graph.scala @@ -159,7 +159,7 @@ class Graph(val schema: Schema, val storagePathMaybe: Option[Path] = None) exten storagePath <- storagePathMaybe if hasChangedSinceOpen } { - logger.debug(s"closing graph: start writing changes to $storagePathMaybe") + logger.debug(s"closing graph: start writing changes to $storagePath") Serialization.writeGraph(this, storagePath) logger.info(s"closed graph at $storagePath}") }