use of java.util.logging.LogRecord in project buck by facebook.
the class JavaUtilsLoggingBuildListener method buildStarted.
@Subscribe
public void buildStarted(BuildEvent.Started started) {
LogRecord record = new LogRecord(LEVEL, "Build started");
record.setMillis(started.getTimestamp());
LOG.log(record);
}
use of java.util.logging.LogRecord in project buck by facebook.
the class JavaUtilsLoggingBuildListener method ruleStarted.
@Subscribe
public void ruleStarted(BuildRuleEvent.Started started) {
LogRecord record = new LogRecord(LEVEL, started.toString());
record.setMillis(started.getTimestamp());
LOG.log(record);
}
use of java.util.logging.LogRecord in project buck by facebook.
the class JavaUtilsLoggingBuildListener method ruleFinished.
@Subscribe
public void ruleFinished(BuildRuleEvent.Finished finished) {
LogRecord record = new LogRecord(LEVEL, finished.toLogMessage());
record.setMillis(finished.getTimestamp());
LOG.log(record);
}
use of java.util.logging.LogRecord in project buck by facebook.
the class JavaUtilsLoggingBuildListener method ruleSuspended.
@Subscribe
public void ruleSuspended(BuildRuleEvent.Suspended suspended) {
LogRecord record = new LogRecord(LEVEL, suspended.toString());
record.setMillis(suspended.getTimestamp());
LOG.log(record);
}
use of java.util.logging.LogRecord in project buck by facebook.
the class MemoryHandler method publish.
@Override
public void publish(LogRecord record) {
if (!isLoggable(record)) {
return;
}
List<LogRecord> recordsToLog = null;
synchronized (buffer) {
int ix = (start + count) % buffer.length;
buffer[ix] = record;
if (count < buffer.length) {
count++;
} else {
start++;
start %= buffer.length;
}
if (record.getLevel().intValue() >= pushLevel.intValue()) {
recordsToLog = new ArrayList<>();
while (count > 0) {
LogRecord oldRecord = buffer[start];
recordsToLog.add(oldRecord);
buffer[start] = null;
start++;
start %= buffer.length;
count--;
}
}
}
}
Aggregations