May 26, 2018

Log to array, with some limits applied

LogDispatchArrayWithLimits functions similarly to LogDispatchArray, with a few differences

  • only the messages strings are stored
  • allow specifying array variable name e.g. “Myarray” instead of \@Myarray This makes it possible to use in LogLog4perl configuration, which is a text file.
  • can apply some limits Currently only max_elems the maximum number of elements in the array is available. Future limits will be added see “TODO”.

Logging to an in-process array can be useful when debugging/testing, or when you want to let users of your program connect to your program to request viewing the ogs being produced.

WWW http//