diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-11-28 21:09:34 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-11-28 21:09:34 +0000 |
commit | c5ff9a6c96c40835f19a7fba47c9594a0ddc91b0 (patch) | |
tree | 38d1a780912592ec46cebc9b209b439701c91bca | |
parent | 025bb5d0ac5fc1c6f63a0991e7db316fba840717 (diff) | |
parent | edec8a8e86c81f0ca96ed9c8dd96ebee7f8856ab (diff) | |
download | rabbitmq-server-c5ff9a6c96c40835f19a7fba47c9594a0ddc91b0.tar.gz |
merge bug19899 into default
-rw-r--r-- | src/rabbit_log.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rabbit_log.erl b/src/rabbit_log.erl index a8f839f0..b4729230 100644 --- a/src/rabbit_log.erl +++ b/src/rabbit_log.erl @@ -32,7 +32,7 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). --export([debug/1, debug/2, info/1, info/2, +-export([debug/1, debug/2, message/4, info/1, info/2, warning/1, warning/2, error/1, error/2]). -import(io). @@ -67,6 +67,10 @@ debug(Fmt) -> debug(Fmt, Args) when is_list(Args) -> gen_server:cast(?SERVER, {debug, Fmt, Args}). +message(Direction, Channel, MethodRecord, Content) -> + gen_server:cast(?SERVER, + {message, Direction, Channel, MethodRecord, Content}). + info(Fmt) -> gen_server:cast(?SERVER, {info, Fmt}). @@ -100,6 +104,14 @@ handle_cast({debug, Fmt, Args}, State) -> io:format("debug:: "), io:format(Fmt, Args), error_logger:info_msg("debug:: " ++ Fmt, Args), {noreply, State}; +handle_cast({message, Direction, Channel, MethodRecord, Content}, State) -> + io:format("~s ch~p ~p~n", + [case Direction of + in -> "-->"; + out -> "<--" end, + Channel, + {MethodRecord, Content}]), + {noreply, State}; handle_cast({info, Fmt}, State) -> error_logger:info_msg(Fmt), {noreply, State}; |