you mean "erlang:trace(PidSpec, How, FlagList)" ,"erlang:trace_pattern(MFA, MatchSpec, FlagList)" ?<br><br>
<div><span class="gmail_quote">2008/6/12, Dave Smith <<a href="mailto:dizzyd@gmail.com">dizzyd@gmail.com</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I think it might be worth noting that Erlang provides some powerful<br>runtime tracing tools. Where in python/java/c++ I would litter my code<br>
with logging statements to keep track of what's happening where, I<br>find myself not needing that as much, since I can simply throw a trace<br>on the things I'm interested in, when/if there are problem. That's why<br>
(I think) erlang is so light on logging subsystems.<br><br>Just a thought.. :)<br><br>D.<br><br>2008/6/12 devdoer bird <<a href="mailto:devdoer2@gmail.com">devdoer2@gmail.com</a>>:<br>> thanks but it also doesn't support log filtering.<br>
> Here is the explanation of filtering from python manual.<br>> "<br>><br>> Filters can be used by Handlers and Loggers for more sophisticated filtering<br>> than is provided by levels. The base filter class only allows events which<br>
> are below a certain point in the logger hierarchy. For example, a filter<br>> initialized with "A.B" will allow events logged by loggers "A.B", "A.B.C",<br>> "A.B.C.D", "A.B.D" etc. but not "<a href="http://A.BB">A.BB</a>", "B.A.B" etc. If initialized with the<br>
> empty string, all events are passed.<br>><br>> class Filter( [name])<br>> Returns an instance of the Filter class. If name is specified, it names a<br>> logger which, together with its children, will have its events allowed<br>
> through the filter. If no name is specified, allows every event.<br>><br>> filter( record)<br>> Is the specified record to be logged? Returns zero for no, nonzero for yes.<br>> If deemed appropriate, the record may be modified in-place by this method.<br>
><br>> "<br>>  I think I need write one by myself.<br>> Thank you .<br>><br>><br>> 2008/6/12, Ulf Wiger (TN/EAB) <<a href="mailto:ulf.wiger@ericsson.com">ulf.wiger@ericsson.com</a>>:<br>>><br>
>> devdoer bird skrev:<br>>>><br>>>> Thanks.<br>>>> I've seen the error logger,but I  need code something to make It support<br>>>> ciritcal levelt setting(info/debug/warming/error)  and filterting(which can<br>
>>> define conditions control  whether one specific log record should be printed<br>>>> )<br>>>>  What I need is more like log4cpp or python's logging module.<br>>>>  And I've stolen some logging code from couchdb and ejabbered ,but they<br>
>>> only support critical level setting .<br>>>>  Is any other logging package you guys know?<br>>><br>>> You can take a look at how mnesia does it.<br>>> Basically, it's this code in mnesia_lib.erl.<br>
>><br>>> BR,<br>>> Ulf W<br>>><br>>><br>>> report_system_event({'EXIT', Reason}, Event) -><br>>>    Mod = mnesia_monitor:get_env(event_module),<br>>>    case mnesia_sup:start_event() of<br>
>>        {ok, Pid} -><br>>>            link(Pid),<br>>>            gen_event:call(mnesia_event, Mod, Event, infinity),<br>>>            unlink(Pid),<br>>><br>>>            %% We get an exit signal if server dies<br>
>>            receive<br>>>                {'EXIT', Pid, _Reason} -><br>>>                    {error, {node_not_running, node()}}<br>>>            after 0 -><br>>>                    gen_event:stop(mnesia_event),<br>
>>                    ok<br>>>            end;<br>>><br>>>        Error -><br>>>            Msg = "Mnesia(~p): Cannot report event ~p: ~p (~p)~n",<br>>>            error_logger:format(Msg, [node(), Event, Reason, Error])<br>
>>    end;<br>>> report_system_event(_Res, _Event) -><br>>>    ignore.<br>>><br>>> %% important messages are reported regardless of debug level<br>>> important(Format, Args) -><br>
>>    save({Format, Args}),<br>>>    report_system_event({mnesia_info, Format, Args}).<br>>><br>>> %% Warning messages are reported regardless of debug level<br>>> warning(Format, Args) -><br>
>>    save({Format, Args}),<br>>>    report_system_event({mnesia_warning, Format, Args}).<br>>><br>>> %% error messages are reported regardless of debug level<br>>> error(Format, Args) -><br>
>>    save({Format, Args}),<br>>>    report_system_event({mnesia_error, Format, Args}).<br>>><br>>> %% verbose messages are reported if debug level == debug or verbose<br>>> verbose(Format, Args) -><br>
>>    case mnesia_monitor:get_env(debug) of<br>>>        none ->    save({Format, Args});<br>>>        verbose -> important(Format, Args);<br>>>        debug ->   important(Format, Args);<br>
>>        trace ->   important(Format, Args)<br>>>    end.<br>>><br>>> %% debug message are display if debug level == 2<br>>> dbg_out(Format, Args) -><br>>>    case mnesia_monitor:get_env(debug) of<br>
>>        none ->    ignore;<br>>>        verbose -> save({Format, Args});<br>>>        _ ->  report_system_event({mnesia_info, Format, Args})<br>>>    end.<br>><br>><br>> _______________________________________________<br>
> erlang-questions mailing list<br>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> <a href="http://www.erlang.org/mailman/listinfo/erlang-questions">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
><br></blockquote></div><br>