package Log::JSON;
use Moose;
use MooseX::Types::Path::Class;
use Carp;
use DateTime;
use English;
use JSON;
use Path::Class::File;
our $VERSION = '0.001'; # VERSION
has 'date' => ( is => 'ro', isa
json = JSON->new->canonical->encode( \%data );
if ( $self->remove_newlines ) {
$json =~ s/\n//g;
$json =~ s/\r//g;
}
my $fh = $self->file->open('>>');
print $fh $json
Log data to a file as JSON
1;
__END__
=pod
=encoding utf-8
=head1 NAME
Log::JSON - Log data to a file as JSON
=head1 SYNOPSIS
use Log::JSON;
my $logger = Log::JSON->new(
file