Java Code Examples for org.pmw.tinylog.Logger#trace()

The following examples show how to use org.pmw.tinylog.Logger#trace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DummyCassandraResultSet.java    From cassandra-jdbc-driver with Apache License 2.0 6 votes vote down vote up
/**
 * This creates a result set based on given data and column definitions.
 *
 * @param columns column definitions, name and its Cql type
 * @param data    rows
 */
public DummyCassandraResultSet(String[][] columns, Object[][] data) {
    super(null, null);

    Logger.trace("Constructing dummy result set @{}...", hashCode());

    if (columns != null && columns.length > 0 && columns[0].length > 1) {
        for (String[] column : columns) {
            Logger.trace("* Column: {name={}, cqlType={}}", column[0], column[1]);

            metadata.addColumnDefinition(new CassandraColumnDefinition(
                    null, null, column[0], column[1], false));
        }
    }

    this.data = data == null ? new String[0][] : data;

    if (LOG_LEVEL.compareTo(Level.TRACE) >= 0) {
        for (Object[] row : this.data) {
            Logger.trace("* Row: {}", Arrays.toString(row));
        }
    }

    Logger.trace("Dummy result set @{} is ready for use", hashCode());
}
 
Example 2
Source File: DummyCassandraResultSet.java    From cassandra-jdbc-driver with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected <T> T getValue(int columnIndex, Class<T> clazz)
        throws SQLException {
    Logger.trace("Trying to get value with inputs: line={}, column={}, type={}", getRow(), columnIndex, clazz);

    Object obj = currentRow[columnIndex - 1];
    T result = null;

    Logger.trace("Got raw value [{}] from line {} of {}", obj, getRow(), data.length);
    wasNull = obj == null;
    result = this.getDataTypeConverters().convert(obj, clazz, false);

    Logger.trace("Return value: raw={}, converted={}", obj, result);

    return result;
}
 
Example 3
Source File: TinylogTest.java    From diozero with MIT License 5 votes vote down vote up
public static void main(String[] args) {
	byte b1 = (byte)55;
	byte b2 = (byte)175;
	Logger.info("hello - info");
	Logger.debug("hello - debug");
	Logger.trace("hello - trace");
	Logger.info("double: {0.##}", Double.valueOf(5454.545464));
	Logger.info("double: {}", String.format("%.2f", Double.valueOf(5454.545464)));
	Logger.debug("setValue({}, {}), old_val=0x{}, new_val=0x{}",
			Integer.valueOf(1), Boolean.valueOf(true), Integer.toHexString(b1), Integer.toHexString(b2));
}
 
Example 4
Source File: CassandraResultSetMetaData.java    From cassandra-jdbc-driver with Apache License 2.0 5 votes vote down vote up
public CassandraColumnDefinition getColumnDefinition(int column)
        throws SQLException {
    if (column > 0 && column <= columnDefinitions.size()) {
        return columnDefinitions.get(column - 1);
    }

    Logger.trace("Columns for your reference: " + columnNameIndices);

    throw new SQLException("Column " + column + " does not exists!");
}
 
Example 5
Source File: CassandraResultSetMetaData.java    From cassandra-jdbc-driver with Apache License 2.0 5 votes vote down vote up
public CassandraColumnDefinition getColumnDefinition(String columnName)
        throws SQLException {
    int column = columnNameIndices.containsKey(columnName) ? columnNameIndices
            .get(columnName) : -1;
    if (column >= 0 && column < columnDefinitions.size()) {
        return columnDefinitions.get(column);
    }

    Logger.trace("Columns for your reference: " + columnNameIndices);

    throw new SQLException("Column " + columnName + " does not exists!");
}
 
Example 6
Source File: CassandraResultSet.java    From cassandra-jdbc-driver with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected <T> T getValue(int columnIndex, Class<T> clazz)
        throws SQLException {
    Logger.trace("Trying to get value with inputs: line={}, column={}, type={}", getRow(), columnIndex, clazz);

    Object rawValue = null;
    T result = null;
    if (_currentRow != null) {
        String typeName = metadata.getColumnTypeName(columnIndex);

        if (clazz == String.class
                && (CassandraDataType.TIME.getTypeName().equals(typeName)
                || CassandraDataType.TIMESTAMP.getTypeName().equals(typeName))) {
            rawValue = _currentRow.getString(columnIndex - 1);
        } else {
            rawValue = _currentRow.getObject(columnIndex - 1);
        }

        Logger.trace("Got raw value [{}] from line #{}", rawValue, getRow());

        wasNull = rawValue == null;

        try {
            result = getDataTypeConverters().convert(rawValue, clazz, true);
        } catch (ClassCastException e) {
            Logger.warn(e, "Not able to convert [{}] to {}", rawValue, clazz);

            if (!quiet) {
                throw new SQLException(e);
            }
        }
    }

    Logger.trace("Return value: raw={}, converted={}", rawValue, result);

    return result;
}
 
Example 7
Source File: TinylogAndLogcatLogger.java    From trackworktime with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int v(String tag, String msg) {
    Logger.trace(msg);
    return Log.v(tag, msg);
}
 
Example 8
Source File: TinylogAndLogcatLogger.java    From trackworktime with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int v(String tag, String msg, Throwable tr) {
    Logger.trace(tr, msg);
    return Log.v(tag, msg, tr);
}