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

Skip to content
Snippets Groups Projects
Commit 9b73fcda authored by str4d's avatar str4d
Browse files

Include priority for logged strings

parent b92e1ee9
No related branches found
No related tags found
No related merge requests found
......@@ -47,10 +47,10 @@ class LogWriter extends LogWriterBase {
}
protected void writeRecord(LogRecord rec, String formatted) {
writeRecord(formatted);
writeRecord(rec.getPriority(), formatted);
}
protected synchronized void writeRecord(String val) {
protected synchronized void writeRecord(int priority, String val) {
if (val == null) return;
if (_currentOut == null) {
rotateFile();
......
......@@ -45,9 +45,10 @@ abstract class LogWriterBase implements Runnable {
protected abstract void writeRecord(LogRecord rec, String formatted);
/**
* Write a single String verbatim to the writer.
* @param priority the level to log the line at.
* @param line the String to write.
*/
protected abstract void writeRecord(String line);
protected abstract void writeRecord(int priority, String line);
protected abstract void flushWriter();
protected abstract void closeWriter();
......@@ -95,7 +96,7 @@ abstract class LogWriterBase implements Runnable {
dupCount++;
} else {
if (dupCount > 0) {
writeRecord(dupMessage(dupCount, _last, false));
writeRecord(_last.getPriority(), dupMessage(dupCount, _last, false));
_manager.getBuffer().add(dupMessage(dupCount, _last, true));
dupCount = 0;
}
......@@ -104,7 +105,7 @@ abstract class LogWriterBase implements Runnable {
_last = rec;
}
if (dupCount > 0) {
writeRecord(dupMessage(dupCount, _last, false));
writeRecord(_last.getPriority(), dupMessage(dupCount, _last, false));
_manager.getBuffer().add(dupMessage(dupCount, _last, true));
}
flushWriter();
......
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