Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Tomcat42
perl-MooX-Log-Any
perl-MooX-Log-Any.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File perl-MooX-Log-Any.spec of Package perl-MooX-Log-Any
# # spec file for package perl-MooX-Log-Any # # Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: perl-MooX-Log-Any Version: 0.004004 Release: 0 %define cpan_name MooX-Log-Any Summary: Role to add Log::Any License: Artistic-1.0 OR GPL-1.0-or-later Group: Development/Libraries/Perl URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/C/CA/CAZADOR/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Log::Any) BuildRequires: perl(Log::Any::Test) BuildRequires: perl(Moo) BuildRequires: perl(Moo::Role) Requires: perl(Log::Any) Requires: perl(Moo::Role) %{perl_requires} %description A logging role building a very lightweight wrapper to Log::Any for use with your Moo or Moose classes. Connecting a Log::Any::Adapter should be performed prior to logging the first log message, otherwise nothing will happen, just like with Log::Any Using the logger within a class is as simple as consuming a role: package MyClass; use Moo; with 'MooX::Log::Any'; 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::Any::Adapter; # Send all logs to Log::Log4perl Log::Any::Adapter->set('Log4perl') use MyClass; my $myclass = MyClass->new(); $myclass->log->info("In my class"); # Access the log of the object $myclass->dummy; # Will log "Dummy log entry" %prep %setup -q -n %{cpan_name}-%{version} %build perl Makefile.PL INSTALLDIRS=vendor make %{?_smp_mflags} %check make test %install %perl_make_install %perl_process_packlist %perl_gen_filelist %files -f %{name}.files %defattr(-,root,root,755) %doc Changes README README.md %license LICENSE %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor