Files
perl-Log-ger/perl-Log-ger.spec

151 lines
5.9 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package perl-Log-ger
#
# Copyright (c) 2024 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/
#
%define cpan_name Log-ger
Name: perl-Log-ger
Version: 0.42.0
Release: 0
%define cpan_version 0.042
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Lightweight, flexible logging framework
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/P/PE/PERLANCAR/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
2025-08-12 18:15:09 +02:00
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Test::More) >= 0.98
BuildRequires: perl(parent)
Requires: perl(parent)
Provides: perl(Log::ger) = %{version}
Provides: perl(Log::ger::Filter) = %{version}
Provides: perl(Log::ger::Filter::Code) = %{version}
Provides: perl(Log::ger::Format) = %{version}
Provides: perl(Log::ger::Format::Default) = %{version}
Provides: perl(Log::ger::Format::MultilevelLog) = %{version}
Provides: perl(Log::ger::Format::None) = %{version}
Provides: perl(Log::ger::Heavy) = %{version}
Provides: perl(Log::ger::Layout) = %{version}
Provides: perl(Log::ger::Output) = %{version}
Provides: perl(Log::ger::Output::Array) = %{version}
Provides: perl(Log::ger::Output::Null) = %{version}
Provides: perl(Log::ger::Output::String) = %{version}
Provides: perl(Log::ger::Plugin) = %{version}
Provides: perl(Log::ger::Plugin::MultilevelLog) = %{version}
Provides: perl(Log::ger::Util) = %{version}
%undefine __perllib_provides
Recommends: perl(Data::Dmp) >= 0.242
Recommends: perl(Sub::Name)
%{perl_requires}
%description
Log::ger is yet another logging framework with the following features:
* * Separation of producers and consumers/listeners
Like Log::Any, this offers a very easy way for modules to produce some logs
without having to configure anything. Configuring output, level, etc can be
done in the application as log consumers/listeners. To read more about
this, see the documentation of Log::Any or Log::ger::Manual (but
nevertheless see Log::ger::Manual on why you might prefer Log::ger to
Log::Any).
* * Lightweight and fast
*Slim distribution.* No non-core dependencies, extra functionalities are
provided in separate distributions to be pulled as needed.
*Low startup overhead.* Only ~0.5-1ms. For comparison, strict ~0.2-0.5ms,
Accepting request 783277 from devel:languages:perl:autoupdate - updated to 0.033 see /usr/share/doc/packages/perl-Log-ger/Changes 0.033 2020-03-07 Released-By: PERLANCAR; Urgency: medium - Rename things for clarity. 1) routine types: log_{sub,method} -> logger_{sub,method}, is_{sub,method} -> level_checker_{sub,method} (old names still accepted for now). 2) hooks: create_is_routine -> create_level_checker, create_log_routine -> create_outputter (old names still accepted for now). This avoids confusion between "logger routine" (the final routine that gets installed to target) vs "outputter" (the routine that does actual sending to output, provided by output plugins). The "is routine" was also a bad name. 0.032 2020-03-06 Released-By: PERLANCAR; Urgency: medium - Introduce filters as a way to do custom filtering as well as to extract additional information from the original logger arguments, e.g. so we can do multilevel log(level=>..., message=>...), pass category log(category=>..., ...) and so on. - [INCOMPATIBLE CHANGE] [removed feature] Remove multilevel (logml) stuffs and reimplement them with filters: remove logml_{subs,methods} routine types, remove create_logml_routine phase, remove ArrayML output. All outputs/plugins that provide create_logml_routine will stop working and will need to be updated. - [INCOMPATIBLE CHANGE] Rename some hook arguments passed to plugin for clarity: target -> target_type, target_arg -> target_name, init_args -> per_target_conf. - Merge Log::ger::Format::Default from Log-ger-Default-Format. - Rename variables/terminologies to be clearer: target -> target type, target arg -> target name, init args -> per-target conf. We also now have per-message conf, produced by filter. 0.031 2020-03-04 Released-By: PERLANCAR; Urgency: medium - Allow each routine to have its own init args; this allows e.g. creating multiple sets of logger subroutines that log to different categories, as implemented in Log::ger::Plugin::Multisets. - Silence 'Redundant argument in sprintf' warning. - [doc] Tweak to make module name and version clearer [GH #2]. 0.030 2020-02-18 Released-By: PERLANCAR; Urgency: low - No functional changes. - [doc] Tweak Synopsis, at least show how to set level & pick multiple outputs. OBS-URL: https://build.opensuse.org/request/show/783277 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Log-ger?expand=0&rev=6
2020-03-10 15:18:26 +00:00
warnings ~2ms, Log::Any (v0.15) ~2-3ms, Log::Any (v1.049) ~8-10ms,
Log::Log4perl ~35ms. This is measured on a 2014-2015 PC and before doing
any output configuration. I strive to make 'use Log::ger;' statement to be
roughly as light as 'use strict;' or 'use warnings;' so the impact of
adding the statement is really minimal and you can just add logging without
much thought to most of your modules. This is important to me because I
want logging to be pervasive.
To test for yourself, try e.g. with bencher-code:
% bencher-code 'use Log::ger' 'use Log::Any' --startup
*Fast*. Low null-/stealth-logging overhead, about 1.5x faster than
Log::Any, 3x faster than Log4perl, 5x faster than Log::Fast, ~40x faster
than Log::Contextual, and ~100x faster than Log::Dispatch.
For more benchmarks, see Bencher::Scenarios::Log::ger.
*Conditional compilation.* There is a plugin to optimize away unneeded
logging statements, like assertion/conditional compilation, so they have
zero runtime performance cost. See Log::ger::Plugin::OptAway.
Being lightweight means the module can be used more universally, from CLI
to long-running daemons to inside routines with tight loops.
* * Flexible
*Customizable levels and routine/method names.* Can be used in a procedural
or OO style. Log::ger can mimic the interface of Log::Any, Log::Contextual,
Log::Log4perl, or some other popular logging frameworks, to ease migration
or adjust with your personal style.
*Per-package settings.* Each importer package can use its own
format/layout, output. For example, a module that is migrated from Log::Any
uses Log::Any-style logging, while another uses native Log::ger style, and
yet some other uses block formatting like Log::Contextual. This eases code
migration and teamwork. Each module author can preserve her own logging
style, if wanted, and all the modules still use the same framework.
*Dynamic.* Outputs and levels can be changed anytime during run-time and
Accepting request 783277 from devel:languages:perl:autoupdate - updated to 0.033 see /usr/share/doc/packages/perl-Log-ger/Changes 0.033 2020-03-07 Released-By: PERLANCAR; Urgency: medium - Rename things for clarity. 1) routine types: log_{sub,method} -> logger_{sub,method}, is_{sub,method} -> level_checker_{sub,method} (old names still accepted for now). 2) hooks: create_is_routine -> create_level_checker, create_log_routine -> create_outputter (old names still accepted for now). This avoids confusion between "logger routine" (the final routine that gets installed to target) vs "outputter" (the routine that does actual sending to output, provided by output plugins). The "is routine" was also a bad name. 0.032 2020-03-06 Released-By: PERLANCAR; Urgency: medium - Introduce filters as a way to do custom filtering as well as to extract additional information from the original logger arguments, e.g. so we can do multilevel log(level=>..., message=>...), pass category log(category=>..., ...) and so on. - [INCOMPATIBLE CHANGE] [removed feature] Remove multilevel (logml) stuffs and reimplement them with filters: remove logml_{subs,methods} routine types, remove create_logml_routine phase, remove ArrayML output. All outputs/plugins that provide create_logml_routine will stop working and will need to be updated. - [INCOMPATIBLE CHANGE] Rename some hook arguments passed to plugin for clarity: target -> target_type, target_arg -> target_name, init_args -> per_target_conf. - Merge Log::ger::Format::Default from Log-ger-Default-Format. - Rename variables/terminologies to be clearer: target -> target type, target arg -> target name, init args -> per-target conf. We also now have per-message conf, produced by filter. 0.031 2020-03-04 Released-By: PERLANCAR; Urgency: medium - Allow each routine to have its own init args; this allows e.g. creating multiple sets of logger subroutines that log to different categories, as implemented in Log::ger::Plugin::Multisets. - Silence 'Redundant argument in sprintf' warning. - [doc] Tweak to make module name and version clearer [GH #2]. 0.030 2020-02-18 Released-By: PERLANCAR; Urgency: low - No functional changes. - [doc] Tweak Synopsis, at least show how to set level & pick multiple outputs. OBS-URL: https://build.opensuse.org/request/show/783277 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Log-ger?expand=0&rev=6
2020-03-10 15:18:26 +00:00
logger routines will be updated automatically. This is useful in situation
like a long-running server application: you can turn on tracing logs
temporarily to debug problems, then turn them off again, without restarting
your server.
*Interoperability.* There are modules to interop with Log::Any, either
consume Log::Any logs (see Log::Any::Adapter::LogGer) or produce logs to be
consumed by Log::Any (see Log::ger::Output::LogAny).
*Many output modules and plugins.* See 'Log::ger::Output::*',
'Log::ger::Format::*', 'Log::ger::Layout::*', 'Log::ger::Plugin::*'.
Writing an output module in Log::ger is easier than writing a
Log::Any::Adapter::*.
For more documentation, start with Log::ger::Manual.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README
%license LICENSE
%changelog