protected void append()

in core-it-support/core-it-plugins/maven-it-plugin-log-file/src/main/java/org/apache/maven/plugin/coreit/AbstractLogMojo.java [77:101]


    protected void append(Object value) throws MojoExecutionException {
        File file = getLogFile();
        getLog().info("[MAVEN-CORE-IT-LOG] Updating log file: " + file);
        getLog().info("[MAVEN-CORE-IT-LOG]   " + value);
        try {
            file.getParentFile().mkdirs();
            OutputStream out = new FileOutputStream(file, true);
            try {
                BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoding));
                if (value != null) {
                    writer.write(value.toString());
                    writer.newLine();
                    writer.flush();
                }
            } finally {
                try {
                    out.close();
                } catch (IOException e) {
                    // just ignore, we tried our best to clean up
                }
            }
        } catch (IOException e) {
            throw new MojoExecutionException("Failed to update log file " + logFile, e);
        }
    }