Skip to content

Can you make FilePrinter.java appendLog() to catch Exception? #70

Open
@jclova

Description

@jclova

void appendLog(String flattenedLog) {
try {
bufferedWriter.write(flattenedLog);
bufferedWriter.newLine();
bufferedWriter.flush();
} catch (IOException e) {
}
}

Can you change catch IOException to Exception?

I am getting many following NullPointerException
Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'void java.io.Writer.write(java.lang.String)' on a null object reference
com.elvishew.xlog.printer.file.FilePrinter$Writer.appendLog (FilePrinter.java:481)

As the application trying to initialize XLog, there are some logs being logged concurrently.
Some logs are being written even before bufferedWriter is initialized.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions