-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can you make FilePrinter.java appendLog() to catch Exception? #70
Comments
@jclova Have you modified the xlog library's source code, like set the By default, Besides, as what you said "Some logs are being written even before bufferedWriter is initialized.", no worry, if you use |
btw, this is what my init method looks like: `public static void init(Context context, boolean isDebug) {
|
Finally figured out the root reason: Make sure only one writing thread, the crash should be resolved Please update to v1.8.0 ASAP, and sorry for letting this issue existing so long |
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.
The text was updated successfully, but these errors were encountered: