Skip to content

Commit b86ae12

Browse files
ml86mpollmeier
andauthored
Only log about graph closing if it is not a zero operation. (#341)
* 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. * Update core/src/main/scala/flatgraph/Graph.scala Co-authored-by: Michael Pollmeier <[email protected]> --------- Co-authored-by: Michael Pollmeier <[email protected]>
1 parent ca81e55 commit b86ae12

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/src/main/scala/flatgraph/Graph.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,16 @@ class Graph(val schema: Schema, val storagePathMaybe: Option[Path] = None) exten
153153
def isClosed: Boolean = closed
154154

155155
override def close(): Unit = {
156-
logger.debug("closing graph")
157156
this.closed = true
158157

159158
for {
160159
storagePath <- storagePathMaybe
161160
if hasChangedSinceOpen
162-
} Serialization.writeGraph(this, storagePath)
163-
164-
logger.info("closed graph")
161+
} {
162+
logger.debug(s"closing graph: start writing changes to $storagePath")
163+
Serialization.writeGraph(this, storagePath)
164+
logger.info(s"closed graph at $storagePath}")
165+
}
165166
}
166167

167168
override def toString(): String =

0 commit comments

Comments
 (0)