From 9ecbc61945b103b0f5be5d29f516973d74683a52 Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Thu, 21 Sep 2023 20:41:06 -0700 Subject: [PATCH] cleanup --- d2layouts/d2layouts.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/d2layouts/d2layouts.go b/d2layouts/d2layouts.go index b73c8ff60..021385edb 100644 --- a/d2layouts/d2layouts.go +++ b/d2layouts/d2layouts.go @@ -76,7 +76,6 @@ func SaveOrder(g *d2graph.Graph) (restoreOrder func()) { func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, coreLayout d2graph.LayoutGraph) error { g.Root.Box = &geo.Box{} - log.Warn(ctx, "ln info", slog.F("gi", graphInfo), slog.F("root level", g.RootLevel)) // Before we can layout these nodes, we need to handle all nested diagrams first. extracted := make(map[*d2graph.Object]*d2graph.Graph) var extractedOrder []*d2graph.Object @@ -128,7 +127,7 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co // There is a nested diagram here, so extract its contents and process in the same way nestedGraph := ExtractSubgraph(curr, gi.IsConstantNear) - log.Info(ctx, "layout nested", slog.F("level", curr.Level()), slog.F("child", curr.AbsID())) + log.Info(ctx, "layout nested", slog.F("level", curr.Level()), slog.F("child", curr.AbsID()), slog.F("gi", gi)) nestedInfo := gi nearKey := curr.NearKey if gi.IsConstantNear { @@ -168,19 +167,19 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co var err error switch graphInfo.DiagramType { case GridDiagram: - log.Warn(ctx, "layout grid", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) + log.Debug(ctx, "layout grid", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) if err = d2grid.Layout2(ctx, g); err != nil { return err } case SequenceDiagram: - log.Warn(ctx, "layout sequence", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) + log.Debug(ctx, "layout sequence", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) err = d2sequence.Layout2(ctx, g, coreLayout) if err != nil { return err } default: - log.Warn(ctx, "default layout", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) + log.Debug(ctx, "default layout", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) err := coreLayout(ctx, g) if err != nil { return err @@ -204,7 +203,7 @@ func LayoutNested(ctx context.Context, g *d2graph.Graph, graphInfo GraphInfo, co PositionNested(n, nestedGraph) } - log.Warn(ctx, "done", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) + log.Debug(ctx, "done", slog.F("rootlevel", g.RootLevel), slog.F("shapes", g.PrintString())) return err }