develooper Front page | perl.perl5.porters | Postings from December 2017

[perl #132468] warnings.pm provides no way to specify the call frame

From:
Father Chrysostomos via RT
Date:
December 10, 2017 22:54
Subject:
[perl #132468] warnings.pm provides no way to specify the call frame
Message ID:
rt-4.0.24-15986-1512946486-1073.132468-15-0@perl.org
On Mon, 20 Nov 2017 01:56:29 -0800, arc wrote:
> Father Chrysostomos <perlbug-followup@perl.org> wrote:
> > warnings::enabled()
> > warnings::enabled($category)
> > warnings::enabled($category,$level) # this is new
> >
> > warnings::fatal_enabled()
> > warnings::fatal_enabled($category)
> > warnings::fatal_enabled($category,$level) # this is new
> >
> > warnings::warn($message)
> > warnings::warn($category,$message)
> > warnings::warn($category,$level,$message) # this is new
> >
> > warnings::warnif($message)
> > warnings::warnif($category,$message)
> > warnings::warnif($category,$level,$message) # this is new
> 
> I think it would be better to use new names for the functions taking a
> level, rather than further overloading the existing names. Here is one
> set of straw-man possibilities (though I'm much more interested in
> picking *any* new names than these particular ones):
> 
> warnings::enabled_at_level
> warnings::fatal_enabled_at_level
> warnings::warn_for_level
> warnings::warnif_for_level

I think _at_ would make sense for all four, since the warning will say ‘at xxx line xxx’.

If nobody objects, I will go ahead and implement _at_level versions of these soonish.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=132468



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About