diff options
author | Hans Nilsson <[email protected]> | 2018-02-28 16:47:20 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2018-03-29 11:58:28 +0200 |
commit | 3715deff44f38aa35873106cd1f116c74c65040a (patch) | |
tree | 858ee3c036609eab1f717c5fd42a9b606465026a /lib/ssh/src/ssh_sftp.erl | |
parent | 3352eaf189c55e60778fc76b94530fac0c314fba (diff) | |
download | otp-3715deff44f38aa35873106cd1f116c74c65040a.tar.gz otp-3715deff44f38aa35873106cd1f116c74c65040a.tar.bz2 otp-3715deff44f38aa35873106cd1f116c74c65040a.zip |
ssh: Use the new ssh_dbg module
Diffstat (limited to 'lib/ssh/src/ssh_sftp.erl')
-rw-r--r-- | lib/ssh/src/ssh_sftp.erl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl index 9e1229dc85..f00c0aed1f 100644 --- a/lib/ssh/src/ssh_sftp.erl +++ b/lib/ssh/src/ssh_sftp.erl @@ -52,6 +52,8 @@ %% TODO: Should be placed elsewhere ssh_sftpd should not call functions in ssh_sftp! -export([info_to_attr/1, attr_to_info/1]). +-export([dbg_trace/3]). + -record(state, { xf, @@ -1460,3 +1462,21 @@ format_channel_start_error({shutdown, Reason}) -> Reason; format_channel_start_error(Reason) -> Reason. + +%%%################################################################ +%%%# +%%%# Tracing +%%%# + +dbg_trace(points, _, _) -> [terminate]; + +dbg_trace(flags, terminate, _) -> [c]; +dbg_trace(on, terminate, _) -> dbg:tp(?MODULE, terminate, 2, x); +dbg_trace(off, terminate, _) -> dbg:ctpg(?MODULE, terminate, 2); +dbg_trace(format, terminate, {call, {?MODULE,terminate, [Reason, State]}}) -> + ["Sftp Terminating:\n", + io_lib:format("Reason: ~p,~nState:~n~s", [Reason, wr_record(State)]) + ]. + +?wr_record(state). + |