Merge branch 'ent-12507-hay-macros-de-eventos-que-no-funcionan-en-el-eventserver' into 'develop'

Added function to pretty print json

See merge request artica/pandorafms!6704
This commit is contained in:
Rafael Ameijeiras 2023-12-04 08:20:22 +00:00
commit 3f2d9e0cb1
1 changed files with 13 additions and 0 deletions

View File

@ -181,6 +181,7 @@ our @EXPORT = qw(
check_cron_value
check_cron_element
cron_check
p_pretty_json
);
# ID of the different servers
@ -2977,6 +2978,18 @@ sub get_server_name {
return "UNKNOWN";
}
################################################################################
# Pretty print json.
################################################################################
sub p_pretty_json {
my ($data) = @_;
# Initialize JSON manager.
my $j = JSON->new->utf8(1)->pretty(1)->indent(1);
my $output = $j->encode($data);
return $output;
}
1;
__END__