Skip to content

Commit 3622bbf

Browse files
committed
GraphVizExt: Add show_logs method
1 parent 768eb16 commit 3622bbf

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ext/GraphVizExt.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,15 @@ function Dagger.render_logs(logs::Dict, ::Val{:graphviz}; disconnected=false,
4040
return gv
4141
end
4242

43+
function Dagger.show_logs(io::IO, logs::Dict, ::Val{:graphviz}; disconnected=false,
44+
color_by=:fn, layout_engine="dot",
45+
times::Bool=true, times_digits::Integer=3,
46+
colors=Dagger.Viz.default_colors,
47+
name_to_color=Dagger.Viz.name_to_color)
48+
dot = Dagger.Viz.logs_to_dot(logs; disconnected, times, times_digits,
49+
color_by, colors, name_to_color)
50+
write(io, dot)
51+
return
52+
end
53+
4354
end

test/logging.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,14 @@ import Colors, GraphViz, DataFrames, Plots, JSON3
177177
logs = Dagger.fetch_logs!()
178178

179179
# GraphVizExt
180+
@test Dagger.show_logs(logs, :graphviz) isa String
180181
@test Dagger.render_logs(logs, :graphviz) !== nothing
181182

182183
# PlotsExt
183184
@test Dagger.render_logs(logs, :plots_gantt) !== nothing
184185

185186
# JSON3Ext
186-
@test Dagger.render_logs(logs, :chrome_trace) !== nothing
187+
@test Dagger.show_logs(logs, :chrome_trace) !== nothing
187188

188189
Dagger.disable_logging!()
189190
end

0 commit comments

Comments
 (0)