Search in sources :

Example 1 with LogRecord

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.$();
    }
}
Also used : LogRecord(io.questdb.log.LogRecord) Record(io.questdb.cairo.sql.Record) LogRecord(io.questdb.log.LogRecord)

Example 2 with LogRecord

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').$();
    }
}
Also used : LogRecord(io.questdb.log.LogRecord)

Example 3 with LogRecord

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);
}
Also used : LogRecord(io.questdb.log.LogRecord)

Example 4 with LogRecord

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;
    }
}
Also used : LogRecord(io.questdb.log.LogRecord)

Aggregations

LogRecord (io.questdb.log.LogRecord)4 Record (io.questdb.cairo.sql.Record)1