SYNOPSIS

     use Data::Sah::Format qw(gen_formatter);
    
     my $c = gen_formatter(
         format => 'iso8601_date',
         #format_args => {...},
     );
    
     my $val;
     $val = $c->(1465784006);   # "2016-06-13"
     $val = $c->(DateTime->new(year=>2016, month=>6, day=>13)); # "2016-06-13"
     $val = $c->("2016-06-13"); # unchanged
     $val = $c->("9999-99-99"); # unchanged
     $val = $c->("foo");        # unchanged
     $val = $c->([]);           # unchanged

DESCRIPTION

VARIABLES

 $Log_Formatter_Code => bool (default: from ENV or 0)

    If set to true, will log the generated formatter code (currently using
    Log::Any at trace level). To see the log message, e.g. to the screen,
    you can use something like:

     % TRACE=1 perl -MLog::Any::Adapter=Screen -MData::Sah::Format=gen_formatter \
         -E'my $c = gen_formatter(...)'

ENVIRONMENT

 LOG_SAH_FORMATTER_CODE => bool

    Set default for $Log_Formatter_Code.

SEE ALSO

    Data::Sah

    Data::Sah::FormatterJS

    App::SahUtils, including format-with-sah to conveniently test
    formatting from the command-line.

