#!/usr/bin/env perl

use strict;
use warnings;

use File::Basename qw(basename);
use File::Spec;
use FindBin qw($Bin);

my $command = basename($0);
my $core = File::Spec->catfile( $Bin, '_dashboard-core' );
exec { $^X } $^X, $core, $command, @ARGV;
die "Unable to exec $core for $command: $!";

__END__

=pod

=head1 NAME

log - private built-in log helper for Developer Dashboard

=head1 SYNOPSIS

  d2 log
  d2 log web
  d2 log collector
  d2 log collector alpha.collector

=head1 DESCRIPTION

This private helper is staged under F<~/.developer-dashboard/cli/dd/> so the
public C<d2> entrypoint can stay a thin switchboard.

=for comment FULL-POD-DOC START

=head1 PURPOSE

This staged helper exposes the top-level log viewer for Developer Dashboard so
operators can inspect web logs, collector logs, or both from one command family
without needing to remember the nested collector and serve subcommands.

=head1 WHY IT EXISTS

It exists because log viewing is built-in runtime behavior, but the public
switchboard should dispatch to a staged helper while shared log parsing and
rendering live in reusable Perl modules.

=head1 WHEN TO USE

Use this file when changing the public C<d2 log> or C<d2 logs>
CLI contract, the staged helper dispatch path, or the examples operators use
for web versus collector log inspection.

=head1 HOW TO USE

Users run C<d2 log>, C<d2 logs>, C<d2 log web>, or
C<d2 log collector [name]>. The helper re-enters the private runtime,
which loads the shared runtime-control module and prints the requested log
stream.

=head1 WHAT USES IT

It is used by operators inspecting runtime logs, by smoke tests that pin the
public log contract, and by the thin loader tests that ensure log stays a
staged built-in helper instead of bloating the public entrypoint.

=head1 EXAMPLES

  d2 log
  d2 logs
  d2 log web -n 50
  d2 log collector housekeeper

=for comment FULL-POD-DOC END

=cut
