Skip to content

Commit

Permalink
feat: puts trace log to console
Browse files Browse the repository at this point in the history
  • Loading branch information
feng19 committed Apr 28, 2024
1 parent c149792 commit 0335495
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/x_trace/io_server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule XTrace.IoServer do
{:put_chars, :unicode, m, f, a} -> put_chars(m, f, a)
end

IO.puts(msg)
Phoenix.PubSub.broadcast(XTrace.PubSub, @topic, {:io_stream, msg})
send(from, {:io_reply, reply_as, :ok})
{:noreply, state}
Expand Down
4 changes: 2 additions & 2 deletions lib/x_trace_web/controllers/trace_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ defmodule XTraceWeb.TraceLive do
io_server = IoServer.pid()
Process.group_leader(self(), io_server)
ensure_loaded(t_specs)
IoServer.puts("Extrace.calls(#{inspect(t_specs)}, #{inspect(max)}, #{inspect(options)}")
IoServer.puts("Extrace.calls(#{inspect(t_specs)}, #{inspect(max)}, #{inspect(options)})")

Extrace.calls(t_specs, max, [{:io_server, io_server} | options])
|> format_calls_return()
Expand Down Expand Up @@ -572,7 +572,7 @@ defmodule XTraceWeb.TraceLive do

ensure_loaded(node, t_specs)

IoServer.puts("Extrace.calls(#{inspect(t_specs)}, #{inspect(max)}, #{inspect(options)}")
IoServer.puts("Extrace.calls(#{inspect(t_specs)}, #{inspect(max)}, #{inspect(options)})")

call(node, XTrace.Executor, :calls, [t_specs, max, options, io_server])
|> format_calls_return()
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule XTrace.MixProject do
def project do
[
app: @app,
version: "0.1.2",
version: "0.1.3",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit 0335495

Please sign in to comment.