on_finalized_text(text, stream_end) {
        if (text.length > 0) {
            this.callback_function?.(text);
        }
        if (stream_end && this.callback_function === stdout_write && apis.IS_PROCESS_AVAILABLE) {
            this.callback_function?.('\n');
        }
    }
Prints the new text to stdout. If the stream is ending, also prints a newline.
@param {string} text 
@param {boolean} stream_end