Skip to content

Commit

Permalink
Remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-akya committed Sep 20, 2024
1 parent 9d57903 commit 3cfe967
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
21 changes: 0 additions & 21 deletions lib/ex_cmd/process.ex
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,6 @@ defmodule ExCmd.Process do

@impl true
def handle_cast({:prepare_exit, caller, timeout}, state) do
IO.inspect({:cast, :prepare_exit, timeout})

state = close_pipes(state, caller)

case maybe_shutdown(state) do
Expand All @@ -597,8 +595,6 @@ defmodule ExCmd.Process do

@impl true
def handle_call({:change_pipe_owner, pipe_name, new_owner}, _from, state) do
IO.inspect({:change_pipe_owner, pipe_name, new_owner})

with {:ok, pipe} <- State.pipe(state, pipe_name),
{:ok, new_pipe} <- Pipe.set_owner(pipe, new_owner),
{:ok, state} <- State.put_pipe(state, pipe_name, new_pipe) do
Expand All @@ -610,8 +606,6 @@ defmodule ExCmd.Process do
end

def handle_call({:close_pipe, pipe_name}, {caller, _} = from, state) do
IO.inspect({:close_pipe, pipe_name})

with {:ok, pipe} <- State.pipe(state, pipe_name),
{:ok, new_pipe} <- Pipe.close(pipe, caller),
:ok <- GenServer.reply(from, :ok),
Expand All @@ -624,8 +618,6 @@ defmodule ExCmd.Process do
end

def handle_call({:read_stdout, size}, from, state) do
IO.inspect({:read_stdout, size})

case Operations.read(state, {:read_stdout, from, size}) do
{:noreply, state} ->
{:noreply, state}
Expand All @@ -636,8 +628,6 @@ defmodule ExCmd.Process do
end

def handle_call({:write_stdin, binary}, from, state) do
IO.inspect({:write_stdin, byte_size(binary)})

case State.pop_operation(state, :write_stdin) do
{:error, :operation_not_found} ->
case Operations.pending_input(state, from, binary) do
Expand Down Expand Up @@ -670,8 +660,6 @@ defmodule ExCmd.Process do
{:exit_sequence, current_stage, timeout, kill_timeout},
%{status: status} = state
) do
IO.inspect({:exit_sequence, current_stage, timeout, kill_timeout, status})

cond do
status != :running ->
{:noreply, state}
Expand All @@ -698,7 +686,6 @@ defmodule ExCmd.Process do

@impl true
def handle_info({port, :eof}, %{port: port} = state) do
IO.inspect({port, :eof})
state = State.set_stdout_status(state, :closed)

case state.status do
Expand Down Expand Up @@ -733,8 +720,6 @@ defmodule ExCmd.Process do

# we are only interested in Port exit signals
def handle_info({:EXIT, port, reason}, %State{port: port} = state) when reason != :normal do
IO.inspect({:EXIT, port, reason})

Operations.pending_callers(state)
|> Enum.each(fn caller ->
:ok = GenServer.reply(caller, {:error, :epipe})
Expand All @@ -753,14 +738,10 @@ defmodule ExCmd.Process do
{:DOWN, owner_ref, :process, _pid, reason},
%State{monitor_ref: owner_ref} = state
) do
IO.inspect({:DOWN, owner_ref, :process, reason})

{:stop, reason, state}
end

def handle_info({:DOWN, _ref, :process, pid, _reason}, state) do
IO.inspect({:DOWN, :process, pid})

state = close_pipes(state, pid)
maybe_shutdown(state)
end
Expand Down Expand Up @@ -866,8 +847,6 @@ defmodule ExCmd.Process do
end

def handle_command(:exit_status, exit_status, state) do
IO.inspect(cmd: {:exit_status, exit_status})

ret =
cond do
exit_status >= 0 ->
Expand Down
1 change: 0 additions & 1 deletion lib/ex_cmd/process/proto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ defmodule ExCmd.Process.Proto do

def write_input(port, bin) do
{chunk, bin} = binary_split_at(bin, @max_chunk_size)
IO.inspect({:remaining, byte_size(bin)})
send_command(input(), chunk, port)
{:ok, bin}
end
Expand Down

0 comments on commit 3cfe967

Please sign in to comment.