Group
Extension

Matches 2

Log-Message-Structured ( D/DA/DAMS/Log-Message-Structured-0.011.tar.gz, DAMS, 2012; MetaCPAN )
Log-Message-Structured/lib/Log/Message/Structured.pm ( view source; MetaCPAN )
     Log::Message::Structured::Component::Hostname
        Log::Message::Structured::Stringify::AsJSON
    /;

    has foo => ( is => 'ro', required => 1 );

    ... elsewhere ...

    use aliased 'My
either pass around in your application, log in a traditional
manor as a log line, or serialize to JSON or YAML for transmission over the
network.

=head1 COMPONENTS

The consuming class can include co
m L<Log::Message::Structured::Stringify::Sprintf>

=item L<Log::Message::Structured::Stringify::AsJSON>

=item L<Log::Message::Structured::Stringify::AsYAML>

=back

=head1 AUTHOR AND COPYRIGHT

Tomas
Log-Message-Structured ( D/DA/DAMS/Log-Message-Structured-0.011.tar.gz, DAMS, 2012; MetaCPAN )
Log-Message-Structured/lib/Log/Message/Structured/Stringify/AsJSON.pm ( view source; MetaCPAN )
package Log::Message::Structured::Stringify::AsJSON;
use Moose::Role;
use namespace::autoclean;

use JSON::Any;
use utf8 ();

requires 'as_hash';

around 'as_string' => sub {
    my $orig = shift;
   
as_hash;
    my $json = JSON::Any->objToJson( $hashref );
    utf8::decode($json) if !utf8::is_utf8($json) and utf8::valid($json); # if it's valid utf8 mark it as such
    return $json;
};


1;

__END
__

=pod

=head1 NAME

Log::Message::Structured::Stringify::AsJSON - JSON log lines

=head1 SYNOPSIS

    package MyLogEvent;
    use Moose;
    use namespace::autoclean;

    with qw/
        Log::Me

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.