Package;
use Log::Report 'my-domain', %configure;
# external file for configuration (perl or json format)
use Log::Report 'my-domain', config => $filename;
use Log::Report 'my-domain';
tex
command) or end on '.json'. See also chapter L</Configuring> below.
Currently, this file can be in Perl native format (when ending on C<.pl>)
or JSON (when it ends with C<.json>). Various modules
ssing key '$key' in format '$format', file $use
Cast by C<configure()>
=item Fault: cannot open JSON file for context at $fn: $!
Cast by C<readConfig()>
=item Error: the native_language '$locale'
nd_as(JSON => {
error => 1,
error_description => $msg->toString,
}, {
content_type => 'application/json; charset=UTF-8',
});
};
example: Return JSON resp
lication/json
fatal_handler sub {
my ($dsl, $msg, $reason, $default) = @_;
(my $ctype = $dsl->request->header('content-type')) =~ s/;.*//;
return if $ctype ne 'application/json';
s
ror' : 'Bad Request';
$dsl->send_as(JSON => {
error => 1,
description => $msg->toString,
}, {
content_type => 'application/json; charset=UTF-8',
});
};
=item $
~ m/\.json$/i)
{ eval "require JSON"; panic $@ if $@;
open my($fh), '<:encoding(utf8)', $fn
or fault __x"cannot open JSON file for context at {fn}", fn => $fn;
local $/;
$config = JSON->utf8