how to pass a error_loger to erlang-mysql?

wenew zhang <>
Thu Jul 2 06:01:47 CEST 2009


erlang-mysql driver have a LogFun Arg,i want pass error_loger:info_msg to
it,
i try:
mysql:start_link(...,error_loger:info_msg),
mysql:start_link(...,info_msg/2),
mysql:start_link(...,info_msg),
i can't work out!

some code below,i'm confused with log/4 and the macros defined


start_link(PoolId, Host, Port, User, Password, Database, LogFun) ->
init([PoolId, Host, Port, User, Password, Database, LogFun, Encoding]) ->
    LogFun1 = if LogFun == undefined -> fun log/4; true -> LogFun end,
-- 
-define(Log(LogFun,Level,Msg),
    LogFun(?MODULE, ?LINE,Level,fun()-> {Msg,[]} end)).
-define(Log2(LogFun,Level,Msg,Params),
    LogFun(?MODULE, ?LINE,Level,fun()-> {Msg,Params} end)).
-define(L(Msg), io:format("~p:~b ~p ~n", [?MODULE, ?LINE, Msg])).


More information about the erlang-questions mailing list