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

Comparing AnyEvent/lib/AnyEvent/Log.pm (file contents):
Revision 1.67 by root, Sun May 12 10:32:26 2019 UTC vs.
Revision 1.68 by root, Sun May 12 11:14:13 2019 UTC

594 594
595=item $ctx = AnyEvent::Log::ctx [$pkg] 595=item $ctx = AnyEvent::Log::ctx [$pkg]
596 596
597This function creates or returns a logging context (which is an object). 597This function creates or returns a logging context (which is an object).
598 598
599If a package name is given, then the context for that packlage is 599If a package name is given, then the context for that package is
600returned. If it is called without any arguments, then the context for the 600returned. If it is called without any arguments, then the context for the
601callers package is returned (i.e. the same context as a C<AE::log> call 601callers package is returned (i.e. the same context as a C<AE::log> call
602would use). 602would use).
603 603
604If C<undef> is given, then it creates a new anonymous context that is not 604If C<undef> is given, then it creates a new anonymous context that is not
884sub attach { 884sub attach {
885 my $ctx = shift; 885 my $ctx = shift;
886 886
887 $ctx->[2]{$_+0} = $_ 887 $ctx->[2]{$_+0} = $_
888 for map { AnyEvent::Log::ctx $_ } @_; 888 for map { AnyEvent::Log::ctx $_ } @_;
889 AnyEvent::Log::_reassess;
889} 890}
890 891
891sub detach { 892sub detach {
892 my $ctx = shift; 893 my $ctx = shift;
893 894
894 delete $ctx->[2]{$_+0} 895 delete $ctx->[2]{$_+0}
895 for map { AnyEvent::Log::ctx $_ } @_; 896 for map { AnyEvent::Log::ctx $_ } @_;
897 AnyEvent::Log::_reassess;
896} 898}
897 899
898sub slaves { 900sub slaves {
899 undef $_[0][2]; 901 undef $_[0][2];
900 &attach; 902 &attach;
903 AnyEvent::Log::_reassess;
901} 904}
902 905
903=back 906=back
904 907
905=head3 LOG TARGETS 908=head3 LOG TARGETS

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines