ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/Debug.pm
(Generate patch)

Comparing Coro/Coro/Debug.pm (file contents):
Revision 1.24 by root, Thu Sep 27 16:25:10 2007 UTC vs.
Revision 1.25 by root, Thu Sep 27 16:28:08 2007 UTC

159 159
160 $coro ||= $Coro::current; 160 $coro ||= $Coro::current;
161 $loglevel = 5 unless defined $loglevel; 161 $loglevel = 5 unless defined $loglevel;
162 162
163 (Coro::async_pool { 163 (Coro::async_pool {
164 if (eval { $coro->trace (Coro::State::CC_TRACE | Coro::State::CC_TRACE_SUB); 1 }) { 164 if (eval { Coro::State::trace $coro, Coro::State::CC_TRACE | Coro::State::CC_TRACE_SUB; 1 }) {
165 Coro::Debug::log $loglevel, sprintf "[%d] tracing enabled", $coro + 0; 165 Coro::Debug::log $loglevel, sprintf "[%d] tracing enabled", $coro + 0;
166 $coro->{_trace_line_cb} = sub { 166 $coro->{_trace_line_cb} = sub {
167 Coro::Debug::log $loglevel, sprintf "[%d] at %s:%d\n", $Coro::current+0, @_; 167 Coro::Debug::log $loglevel, sprintf "[%d] at %s:%d\n", $Coro::current+0, @_;
168 }; 168 };
169 $coro->{_trace_sub_cb} = sub { 169 $coro->{_trace_sub_cb} = sub {
190} 190}
191 191
192sub untrace { 192sub untrace {
193 my ($coro) = @_; 193 my ($coro) = @_;
194 194
195 $coro->trace (0); 195 Coro::State::trace $coro, 0;
196 delete $coro->{_tracr_sub_cb}; 196 delete $coro->{_tracr_sub_cb};
197 delete $coro->{_trace_line_cb}; 197 delete $coro->{_trace_line_cb};
198} 198}
199 199
200=item command $string 200=item command $string

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines