How to Install and Uninstall perl-MooseX-Log-Log4perl Package on openSuSE Tumbleweed

Last updated: May 18,2024

1. Install "perl-MooseX-Log-Log4perl" package

Please follow the step by step instructions below to install perl-MooseX-Log-Log4perl on openSuSE Tumbleweed

$ sudo zypper refresh $ sudo zypper install perl-MooseX-Log-Log4perl

2. Uninstall "perl-MooseX-Log-Log4perl" package

This is a short guide on how to uninstall perl-MooseX-Log-Log4perl on openSuSE Tumbleweed:

$ sudo zypper remove perl-MooseX-Log-Log4perl

3. Information about the perl-MooseX-Log-Log4perl package on openSuSE Tumbleweed

Information for package perl-MooseX-Log-Log4perl:
-------------------------------------------------
Repository : openSUSE-Tumbleweed-Oss
Name : perl-MooseX-Log-Log4perl
Version : 0.47-2.24
Arch : noarch
Vendor : openSUSE
Installed Size : 19.9 KiB
Installed : No
Status : not installed
Source package : perl-MooseX-Log-Log4perl-0.47-2.24.src
Upstream URL : http://search.cpan.org/dist/MooseX-Log-Log4perl/
Summary : Logging Role for Moose based on Log::Log4perl
Description :
A logging role building a very lightweight wrapper to Log::Log4perl for use
with your Moose or Moo classes. The initialization of the Log4perl instance
must be performed prior to logging the first log message. Otherwise the
default initialization will happen, probably not doing the things you
expect.
For compatibility the 'logger' attribute can be accessed to use a common
interface for application logging.
Using the logger within a class is as simple as consuming a role:
package MyClass;
use Moose;
with 'MooseX::Log::Log4perl';
sub dummy {
my $self = shift;
$self->log->info("Dummy log entry");
}
The logger needs to be setup before using the logger, which could happen in
the main application:
package main;
use Log::Log4perl qw(:easy);
use MyClass;
BEGIN { Log::Log4perl->easy_init() };
my $myclass = MyClass->new();
$myclass->log->info("In my class"); # Access the log of the object
$myclass->dummy; # Will log "Dummy log entry"