Don't write newline to metadata JSON string for base function that's reused by other components. When it is written out as a line, use newline character instead of std::endl to avoid unnecessary flushes.