aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test/telnet_server.erl
diff options
context:
space:
mode:
authorPeter Andersson <peppe@erlang.org>2014-01-10 16:03:54 +0100
committerPeter Andersson <peppe@erlang.org>2014-01-27 19:38:10 +0100
commit584f9ec69fea19e1fed4a37699cb83e0d3c9bf94 (patch)
treef96bef67262602c13d7102c8d887b86417376a7c /lib/common_test/test/telnet_server.erl
parentbece9227ecffb5f164a383a826f63835bd32175a (diff)
downloadotp-584f9ec69fea19e1fed4a37699cb83e0d3c9bf94.tar.gz
otp-584f9ec69fea19e1fed4a37699cb83e0d3c9bf94.tar.bz2
otp-584f9ec69fea19e1fed4a37699cb83e0d3c9bf94.zip
Implement new telnet logging system
Diffstat (limited to 'lib/common_test/test/telnet_server.erl')
-rw-r--r--lib/common_test/test/telnet_server.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/common_test/test/telnet_server.erl b/lib/common_test/test/telnet_server.erl
index 31884aa182..1760100d8e 100644
--- a/lib/common_test/test/telnet_server.erl
+++ b/lib/common_test/test/telnet_server.erl
@@ -64,18 +64,19 @@ accept(#state{listen=LSock}=State) ->
{Acceptor,Sock} when is_port(Sock) ->
case init_client(State#state{client=Sock}) of
stopped ->
- io:format("telnet_server stopped\n"),
+ io:format("[telnet_server] telnet_server stopped\n"),
ok;
R ->
- io:format("connection to client closed with reason ~p~n",[R]),
+ io:format("[telnet_server] connection to client"
+ "closed with reason ~p~n",[R]),
accept(State)
end;
{Acceptor,closed} ->
- io:format("listen socket closed unexpectedly, "
+ io:format("[telnet_server] listen socket closed unexpectedly, "
"terminating telnet_server\n"),
ok;
stop ->
- io:format("telnet_server stopped\n"),
+ io:format("[telnet_server] telnet_server stopped\n"),
ok
end.
@@ -188,7 +189,7 @@ do_handle_data(_Data,State) ->
check_user(User,State) ->
case lists:keyfind(User,1,State#state.users) of
{User,Pwd} ->
- dbg("user ok\n"),
+ dbg("user ok\n"),
send("Password: ",State),
{ok,State#state{authorized={user,Pwd}}};
false ->
@@ -223,6 +224,6 @@ get_line([],_) ->
false.
dbg(_F) ->
- io:format(_F).
+ dbg(_F,[]).
dbg(_F,_A) ->
- io:format(_F,_A).
+ io:format("[telnet_server] "++_F,_A).