use of io.questdb.log.LogRecord in project questdb by bluestreak01.
the class RecordCursorPrinter method print.
public void print(RecordCursor cursor, RecordMetadata metadata, boolean header, Log sink) {
LogRecordSinkAdapter logRecSink = new LogRecordSinkAdapter();
if (header) {
LogRecord line = sink.xDebugW();
printHeaderNoNl(metadata, logRecSink.of(line));
line.$();
}
final Record record = cursor.getRecord();
while (cursor.hasNext()) {
LogRecord line = sink.xDebugW();
printRecordNoNl(record, metadata, logRecSink.of(line));
line.$();
}
}
use of io.questdb.log.LogRecord in project questdb by bluestreak01.
the class ServerMain method logWebConsoleUrls.
private static void logWebConsoleUrls(Log log, PropServerConfiguration configuration) throws SocketException {
final LogRecord record = log.info().$("web console URL(s):").$('\n').$('\n');
final int httpBindIP = configuration.getHttpServerConfiguration().getDispatcherConfiguration().getBindIPv4Address();
final int httpBindPort = configuration.getHttpServerConfiguration().getDispatcherConfiguration().getBindPort();
if (httpBindIP == 0) {
Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();
for (NetworkInterface networkInterface : Collections.list(nets)) {
Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
for (InetAddress inetAddress : Collections.list(inetAddresses)) {
if (inetAddress instanceof Inet4Address) {
record.$('\t').$("http:/").$(inetAddress).$(':').$(httpBindPort).$('\n');
}
}
}
record.$('\n').$();
} else {
record.$('\t').$("http://").$ip(httpBindIP).$(':').$(httpBindPort).$('\n').$();
}
}
use of io.questdb.log.LogRecord in project questdb by bluestreak01.
the class CairoTextWriter method logError.
private void logError(long line, int i, DirectByteCharSequence dbcs) {
LogRecord logRecord = LOG.error().$("type syntax [type=").$(ColumnType.nameOf(types.getQuick(i).getType())).$("]\n\t");
logRecord.$('[').$(line).$(':').$(i).$("] -> ").$(dbcs).$();
columnErrorCounts.increment(i);
}
use of io.questdb.log.LogRecord in project questdb by bluestreak01.
the class TextLexer method extraField.
private void extraField(int fieldIndex) {
LogRecord logRecord = LOG.error().$("extra fields [table=").$(tableName).$(", fieldIndex=").$(fieldIndex).$(", fieldMax=").$(fieldMax).$("]\n\t").$(lineCount).$(" -> ");
for (int i = 0, n = fields.size(); i < n; i++) {
if (i > 0) {
logRecord.$(',');
}
logRecord.$(fields.getQuick(i));
}
logRecord.$(" ...").$();
if (skipLinesWithExtraValues) {
errorCount++;
ignoreEolOnce = true;
this.fieldIndex = 0;
} else {
// prepare for next field
if (lastQuotePos > -1) {
lastQuotePos = -1;
}
this.fieldLo = this.fieldHi;
}
}