# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.5.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

package libdnf5::logger;
use base qw(Exporter);
use base qw(DynaLoader);
require libdnf5::common;
require libdnf5::exception;
package libdnf5::loggerc;
bootstrap libdnf5::logger;
package libdnf5::logger;
@EXPORT = qw();

# ---------- BASE METHODS -------------

package libdnf5::logger;

sub TIEHASH {
    my ($classname,$obj) = @_;
    return bless $obj, $classname;
}

sub CLEAR { }

sub FIRSTKEY { }

sub NEXTKEY { }

sub FETCH {
    my ($self,$field) = @_;
    my $member_func = "swig_${field}_get";
    $self->$member_func();
}

sub STORE {
    my ($self,$field,$newval) = @_;
    my $member_func = "swig_${field}_set";
    $self->$member_func($newval);
}

sub this {
    my $ptr = shift;
    return tied(%$ptr);
}


# ------- FUNCTION WRAPPERS --------

package libdnf5::logger;

*create_file_logger = *libdnf5::loggerc::create_file_logger;
*create_rotating_file_logger = *libdnf5::loggerc::create_rotating_file_logger;

############# Class : libdnf5::logger::LoggerUniquePtr ##############

package libdnf5::logger::LoggerUniquePtr;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = libdnf5::loggerc::new_LoggerUniquePtr(@_);
    bless $self, $pkg if defined($self);
}

*__deref__ = *libdnf5::loggerc::LoggerUniquePtr___deref__;
*release = *libdnf5::loggerc::LoggerUniquePtr_release;
*reset = *libdnf5::loggerc::LoggerUniquePtr_reset;
*swap = *libdnf5::loggerc::LoggerUniquePtr_swap;
*get = *libdnf5::loggerc::LoggerUniquePtr_get;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_LoggerUniquePtr($self);
        delete $OWNER{$self};
    }
}

*level_to_cstr = *libdnf5::loggerc::LoggerUniquePtr_level_to_cstr;
*log_line = *libdnf5::loggerc::LoggerUniquePtr_log_line;
*write = *libdnf5::loggerc::LoggerUniquePtr_write;
*critical = *libdnf5::loggerc::LoggerUniquePtr_critical;
*error = *libdnf5::loggerc::LoggerUniquePtr_error;
*warning = *libdnf5::loggerc::LoggerUniquePtr_warning;
*notice = *libdnf5::loggerc::LoggerUniquePtr_notice;
*info = *libdnf5::loggerc::LoggerUniquePtr_info;
*debug = *libdnf5::loggerc::LoggerUniquePtr_debug;
*trace = *libdnf5::loggerc::LoggerUniquePtr_trace;
*log = *libdnf5::loggerc::LoggerUniquePtr_log;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : libdnf5::logger::MemoryBufferLoggerUniquePtr ##############

package libdnf5::logger::MemoryBufferLoggerUniquePtr;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = libdnf5::loggerc::new_MemoryBufferLoggerUniquePtr(@_);
    bless $self, $pkg if defined($self);
}

*__deref__ = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr___deref__;
*release = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_release;
*reset = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_reset;
*swap = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_swap;
*get = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_get;
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_MemoryBufferLoggerUniquePtr($self);
        delete $OWNER{$self};
    }
}

*write = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_write;
*get_items_count = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_get_items_count;
*get_item = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_get_item;
*clear = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_clear;
*write_to_logger = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_write_to_logger;
*level_to_cstr = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_level_to_cstr;
*log_line = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_log_line;
*critical = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_critical;
*error = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_error;
*warning = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_warning;
*notice = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_notice;
*info = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_info;
*debug = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_debug;
*trace = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_trace;
*log = *libdnf5::loggerc::MemoryBufferLoggerUniquePtr_log;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : libdnf5::logger::LogRouterWeakPtr ##############

package libdnf5::logger::LogRouterWeakPtr;
use overload
    "!=" => sub { $_[0]->__ne__($_[1])},
    ">=" => sub { $_[0]->__ge__($_[1])},
    "==" => sub { $_[0]->__eq__($_[1])},
    "<=" => sub { $_[0]->__le__($_[1])},
    ">" => sub { $_[0]->__gt__($_[1])},
    "<" => sub { $_[0]->__lt__($_[1])},
    "=" => sub { my $class = ref($_[0]); $class->new($_[0]) },
    "fallback" => 1;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = libdnf5::loggerc::new_LogRouterWeakPtr(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_LogRouterWeakPtr($self);
        delete $OWNER{$self};
    }
}

*__deref__ = *libdnf5::loggerc::LogRouterWeakPtr___deref__;
*get = *libdnf5::loggerc::LogRouterWeakPtr_get;
*is_valid = *libdnf5::loggerc::LogRouterWeakPtr_is_valid;
*has_same_guard = *libdnf5::loggerc::LogRouterWeakPtr_has_same_guard;
*__ref__ = *libdnf5::loggerc::LogRouterWeakPtr___ref__;
*__eq__ = *libdnf5::loggerc::LogRouterWeakPtr___eq__;
*__ne__ = *libdnf5::loggerc::LogRouterWeakPtr___ne__;
*__lt__ = *libdnf5::loggerc::LogRouterWeakPtr___lt__;
*__gt__ = *libdnf5::loggerc::LogRouterWeakPtr___gt__;
*__le__ = *libdnf5::loggerc::LogRouterWeakPtr___le__;
*__ge__ = *libdnf5::loggerc::LogRouterWeakPtr___ge__;
*add_logger = *libdnf5::loggerc::LogRouterWeakPtr_add_logger;
*get_logger = *libdnf5::loggerc::LogRouterWeakPtr_get_logger;
*release_logger = *libdnf5::loggerc::LogRouterWeakPtr_release_logger;
*swap_logger = *libdnf5::loggerc::LogRouterWeakPtr_swap_logger;
*get_loggers_count = *libdnf5::loggerc::LogRouterWeakPtr_get_loggers_count;
*log_line = *libdnf5::loggerc::LogRouterWeakPtr_log_line;
*write = *libdnf5::loggerc::LogRouterWeakPtr_write;
*level_to_cstr = *libdnf5::loggerc::LogRouterWeakPtr_level_to_cstr;
*critical = *libdnf5::loggerc::LogRouterWeakPtr_critical;
*error = *libdnf5::loggerc::LogRouterWeakPtr_error;
*warning = *libdnf5::loggerc::LogRouterWeakPtr_warning;
*notice = *libdnf5::loggerc::LogRouterWeakPtr_notice;
*info = *libdnf5::loggerc::LogRouterWeakPtr_info;
*debug = *libdnf5::loggerc::LogRouterWeakPtr_debug;
*trace = *libdnf5::loggerc::LogRouterWeakPtr_trace;
*log = *libdnf5::loggerc::LogRouterWeakPtr_log;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : libdnf5::logger::Logger ##############

package libdnf5::logger::Logger;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = $_[0];
    my $self = libdnf5::loggerc::new_Logger(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_Logger($self);
        delete $OWNER{$self};
    }
}

*Level_CRITICAL = *libdnf5::loggerc::Logger_Level_CRITICAL;
*Level_ERROR = *libdnf5::loggerc::Logger_Level_ERROR;
*Level_WARNING = *libdnf5::loggerc::Logger_Level_WARNING;
*Level_NOTICE = *libdnf5::loggerc::Logger_Level_NOTICE;
*Level_INFO = *libdnf5::loggerc::Logger_Level_INFO;
*Level_DEBUG = *libdnf5::loggerc::Logger_Level_DEBUG;
*Level_TRACE = *libdnf5::loggerc::Logger_Level_TRACE;
*level_to_cstr = *libdnf5::loggerc::Logger_level_to_cstr;
*log_line = *libdnf5::loggerc::Logger_log_line;
*write = *libdnf5::loggerc::Logger_write;
*critical = *libdnf5::loggerc::Logger_critical;
*error = *libdnf5::loggerc::Logger_error;
*warning = *libdnf5::loggerc::Logger_warning;
*notice = *libdnf5::loggerc::Logger_notice;
*info = *libdnf5::loggerc::Logger_info;
*debug = *libdnf5::loggerc::Logger_debug;
*trace = *libdnf5::loggerc::Logger_trace;
*log = *libdnf5::loggerc::Logger_log;
sub DISOWN {
    my $self = shift;
    libdnf5::loggerc::disown_Logger($self);
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}

sub FETCH {
    my ($self,$field) = @_;
    my $member_func = "swig_${field}_get";
    if (not $self->can($member_func)) {
        my $h = libdnf5::loggerc::swig_get_attr_Logger($self);
        return $h->{$field} if $h;
    }
    return $self->$member_func;
}

sub STORE {
    my ($self,$field,$newval) = @_;
    my $member_func = "swig_${field}_set";
    if (not $self->can($member_func)) {
        my $h = libdnf5::loggerc::swig_get_attr_Logger($self);
        return $h->{$field} = $newval if $h;
    }
    return $self->$member_func($newval);
}

############# Class : libdnf5::logger::StringLogger ##############

package libdnf5::logger::StringLogger;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger::Logger libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_StringLogger($self);
        delete $OWNER{$self};
    }
}

*write = *libdnf5::loggerc::StringLogger_write;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : libdnf5::logger::LogRouter ##############

package libdnf5::logger::LogRouter;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger::Logger libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_LogRouter($self);
        delete $OWNER{$self};
    }
}

sub new {
    my $pkg = shift;
    my $self = libdnf5::loggerc::new_LogRouter(@_);
    bless $self, $pkg if defined($self);
}

*add_logger = *libdnf5::loggerc::LogRouter_add_logger;
*get_logger = *libdnf5::loggerc::LogRouter_get_logger;
*release_logger = *libdnf5::loggerc::LogRouter_release_logger;
*swap_logger = *libdnf5::loggerc::LogRouter_swap_logger;
*get_loggers_count = *libdnf5::loggerc::LogRouter_get_loggers_count;
*log_line = *libdnf5::loggerc::LogRouter_log_line;
*write = *libdnf5::loggerc::LogRouter_write;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : libdnf5::logger::GlobalLogger ##############

package libdnf5::logger::GlobalLogger;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = libdnf5::loggerc::new_GlobalLogger(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_GlobalLogger($self);
        delete $OWNER{$self};
    }
}

*set = *libdnf5::loggerc::GlobalLogger_set;
*unset = *libdnf5::loggerc::GlobalLogger_unset;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : libdnf5::logger::MemoryBufferLogger ##############

package libdnf5::logger::MemoryBufferLogger;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger::Logger libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = libdnf5::loggerc::new_MemoryBufferLogger(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_MemoryBufferLogger($self);
        delete $OWNER{$self};
    }
}

*write = *libdnf5::loggerc::MemoryBufferLogger_write;
*get_items_count = *libdnf5::loggerc::MemoryBufferLogger_get_items_count;
*get_item = *libdnf5::loggerc::MemoryBufferLogger_get_item;
*clear = *libdnf5::loggerc::MemoryBufferLogger_clear;
*write_to_logger = *libdnf5::loggerc::MemoryBufferLogger_write_to_logger;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


############# Class : libdnf5::logger::RotatingFileLogger ##############

package libdnf5::logger::RotatingFileLogger;
use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
@ISA = qw( libdnf5::logger::StringLogger libdnf5::logger );
%OWNER = ();
%ITERATORS = ();
sub new {
    my $pkg = shift;
    my $self = libdnf5::loggerc::new_RotatingFileLogger(@_);
    bless $self, $pkg if defined($self);
}

sub DESTROY {
    return unless $_[0]->isa('HASH');
    my $self = tied(%{$_[0]});
    return unless defined $self;
    delete $ITERATORS{$self};
    if (exists $OWNER{$self}) {
        libdnf5::loggerc::delete_RotatingFileLogger($self);
        delete $OWNER{$self};
    }
}

*write = *libdnf5::loggerc::RotatingFileLogger_write;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
}

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
}


# ------- VARIABLE STUBS --------

package libdnf5::logger;

1;
