logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Zonemaster::Logger - class that holds Zonemaster::Logger::Entry objects.

Attributes

       entries
           A reference to an array holding Zonemaster::Logger::Entry objects.

       callback($coderef)
           If  this  attribute  is set, the given code reference will be called every time a log entry is added.
           The referenced code will be called with the newly created entry as its single  argument.  The  return
           value of the called code is ignored.

           If   the   called   code  throws  an  exception,  and  the  exception  is  not  an  object  of  class
           Zonemaster::Exception (or a subclass of it), the exception will be logged  as  a  system  message  at
           default level "CRITICAL" and the callback attribute will be cleared.

           If  an  exception that is of (sub)class Zonemaster::Exception is called, the exception will simply be
           rethrown until it reaches the code that started the test run that logged the message.

Class Method

start_time_now()
           Set the logger's start time to the current time.

       clear_history()
           Remove all known log entries.

perl v5.32.0                                       2021-01-06                            Zonemaster::Logger(3pm)

Methods

       add($tag, $argref)
           Adds an entry with the given tag and arguments to the logger object.

       json([$level])
           Returns a JSON-formatted string with all the stored log entries. If an argument is  given  and  is  a
           known severity level, only messages with at least that level will be included.

       get_max_level
           Returns the maximum log level from the entire log as the level string.

Name

       Zonemaster::Logger - class that holds Zonemaster::Logger::Entry objects.

Synopsis

           my $logger = Zonemaster::Logger->new;
           $logger->add( TAG => {some => 'arguments'});

See Also