Fixed bug in plugin API: now pass pointer to allocated log