We decided that this made debugging much easier. A stack dump where
everything is anonymous is impossible to wade through.
You should solve your immediate problem by adding a "log_name" field to
your class' metaclass, default it to the normal name, and then make
create_anon_class copy the log_name from the parent. That way, you can
just say $instance->meta->log_name and always get the right answer
... no messy heuristics required. If you have questions, please ask on
#moose :)
--jrockway
* On Mon, Jul 12 2010, Dan Harbin via RT wrote:
Show quoted text> Mon Jul 12 14:21:28 2010: Request 59284 was acted upon.
> Transaction: Ticket created by dlharbin
> Queue: MooseX-Traits
> Subject: is_anon_class is rendered useless by MooseX::Traits
> Broken in: 0.11
> Severity: Wishlist
> Owner: Nobody
> Requestors: dan.harbin@gmail.com
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=59284 >
>
>
> Why does MooseX::Traits generate its own ANON class names? This makes
> Class::MOP::Class->is_anon_class useless. For example, I want to find
> the first superclass that is not anonymous (for logging purposes):
>
> use List::Util qw/first/;
> ... snip ...
> return first { ! $_->meta()->is_anon_class() } ($self->meta()->name(),
> $self->meta()->superclasses());
>
>
> The workaround is fine, but kludgy:
>
> return first { ! $_->meta()->is_anon_class() && $_ !~
> /MooseX::Traits::__ANON__/ } ($self->meta()->name(),
> $self->meta()->superclasses());
>
--
print just => another => perl => hacker => if $,=$"