I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit c4e6a2f0 authored by jrandom's avatar jrandom Committed by zzz
Browse files

if the log pattern/path referenced doesn't exist, create all necessary parent...

if the log pattern/path referenced doesn't exist, create all necessary parent directories (killing the JVM if it fails, rather than silently gobble the log messages to /dev/null)
parent b56845e2
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,18 @@ class LogWriter implements Runnable {
File f = getNextFile(pattern);
_currentFile = f;
_numBytesInCurrentFile = 0;
File parent = f.getParentFile();
if (!parent.exists()) {
boolean ok = parent.mkdirs();
if (!ok) {
System.err.println("Unable to create the parent directy: " + parent.getAbsolutePath());
System.exit(0);
}
}
if (!parent.isDirectory()) {
System.err.println("wtf, we cannot put the logs in a subdirectory of a plain file! we want to stre the log as " + f.getAbsolutePath());
System.exit(0);
}
try {
_currentOut = new FileOutputStream(f);
} catch (IOException ioe) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment