-%perlcode %{
-=head1 NAME
-
-Amanda::Logfile - manage Amanda trace logs
-
-=head1 SYNOPSIS
-
- use Amanda::Logfile qw(:logtype_t); # XXX change
- use Amanda::Config qw( :getconf config_dir_relative );
-
- for my $logfile (Amanda::Logfile::find_log()) {
- $logfile = config_dir_relative(getconf($CNF_LOGDIR)) . "/" . $logfile;
-
- my $hdl = Amanda::Logfile::open_logfile($logfile);
- while (my ($type, $prog, $str) = Amanda::Logfile::get_logline($hdl)) {
- if ($type == $L_INFO) {
- my $pname = Amanda::Logfile::program_t_to_string($prog);
- print "Found info line from $pname: $str\n";
- }
- }
- Amanda::Logfile::close_logfile($log);
-
- my @dumps = Amanda::Logfile::search_logfile("TapeLabel-001", "19780615", $logfile);
-
- my @matching = Amanda::Logfile::dumps_match([@dumps], "myhost", "/usr", undef, undef, 0);
- for my $dump (@matching) {
- print "$dump->{'label'}:$dump->{'filenum'} = $dump->{'hostname'}:$dump->{'disk'}\n";
- }
- }
-
-=head1 API STATUS
-
-Stabilizing
-
-=head1 RAW LOGFILE ACCESS
-
-This section corresponds to the C C<logfile> module.
-
-Raw access to logfiles is accomplished by opening a logfile and
-fetching log lines one by one via the C<get_logline> function.
-
-A log line is represented by a list C<($type, $prog, $string)>
-where C<$type> is one of the C<L_*> constants (available in export
-tag C<logtype_t>), C<$prog> is one of the C<P_*> constants (available
-in export tag C<program_t>), and C<$str> is the remainder of the line.
-
-Both families of constants can be converted to symbolic names with
-C<logtype_t_to_string> and C<program_t_to_string>, respectively.
-
-=head2 FUNCTIONS
-
-=over
-
-=item C<open_logfile($filename)>
-
-Opens a logfile for reading, returning an opaque log file handle.
-
-=item C<close_logfile($handle)>
-
-Closes a log file handle.
-
-=item C<get_logline($handle)>
-
-Return a list as described above representing the next log line in
-C<$handle>, or nothing at the end of the logfile.
-
-=back
-
-All of these functions can be imported by name if desired.
-
-=head1 Amanda::Find::find_result_t objects
-
-These objects contain information about dumps, as read from logfiles.
-Instance variables are:
-
-=over
-
-=item C<$timestamp>
-
-=item C<$hostname>
-
-=item C<$diskname>
-
-=item C<$level>
-
-=item C<$label>
-
-=item C<$filenum>
-
-=item C<$status>
-
-=item C<$partnum>
-
-=back
-
-=head1 HIGHER-LEVEL FUNCTIONS
-
-Functions in this section extract information from logfiles.
-
-=over
-
-=item C<find_log()>
-
-Return a list of logfiles for active tapes. The tapelist must be loaded before
-this function is called (see L<Amanda::Tapelist>).
-
-=item C<search_logfile($label, $datestamp, $logfile, $add_missing_disks)>
-
-Return all results in C<$logfile> matching C<$label> and C<$datestamp>.
-If C<$add_missing_disks> is true, then any disks in the logfile
-not present in the disklist are added to the disklist; otherwise,
-such dumps are skipped.
-
-=item C<dumps_match([@results], $hostname, $diskname, $datestamp, $level, $ok)>
-
-Return a filtered version of C<@results> containing only results that match the
-given expressions. If C<$ok> is true, don't match partial results. Note that
-C<$level> is given as a string, since it is a match expression.
-
-All of these functions can be imported by name.
-
-=cut
-%}
-