The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mojo::Netdata::Util - Utility functions for Mojo::Netdata

SYNOPSIS

  use Mojo::Netdata::Util qw(safe_id);
  print safe_id 'Not%co.ol';

DESCRIPTION

Mojo::Netdata::Util as functions that can be useful when working with Mojo::Netdata::Collector classes.

EXPORTED FUNCTIONS

logf

  logf $level, $format, @args;

Used to log messages to STDERR. $level can be "debug", "info", "warnings", "error", "fatal". Any references and undefined values in @args will be serialized using "encode_json" in Mojo::JSON.

safe_id

  $str = safe_id $str;

Turns an "unsafe" string into a string you can use for things like "id" or "type". This is called by "to_string" in Mojo::Netdata::Chart and "data_to_string" in Mojo::Netdata::Chart to make sure the output strings are safe.

SEE ALSO

Mojo::Netdata.