Group
Extension

Matches 1

Log-Log4perl-Layout-JSON-Readable ( D/DA/DAKKAR/Log-Log4perl-Layout-JSON-Readable-1.0.3.tar.gz, DAKKAR, 2021; MetaCPAN )
Log-Log4perl-Layout-JSON-Readable/lib/Log/Log4perl/Layout/JSON/Readable.pm ( view source; MetaCPAN )
package Log::Log4perl::Layout::JSON::Readable;

use strict;
use warnings;
use parent 'Log::Log4perl::Layout::JSON';
our $VERSION = '1.0.3'; # VERSION
# ABSTRACT: JSON layout, but some fields always co
shift;

    my $json = $self->SUPER::render(@_);

    if (my $first_fields = $self->first_fields) {
        for my $key (reverse @{$first_fields}) {
            _move_field_first(\$json, $key);
      
   return $json;
}

sub _move_field_first {
    my ($json_ref, $key) = @_;
    # a JSON value starts with double quotes, and ends with a
    # non-backslash-escaped double quotes
    ${$json_ref} =~ s

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