public void logSlowQuery(final Statement statement, final long startTimeNanos, final JdbcSessionContext context) {
		if ( logSlowQuery < 1 ) {
			return;
		}
		if ( startTimeNanos <= 0 ) {
			throw new IllegalArgumentException( "startTimeNanos [" + startTimeNanos + "] should be greater than 0" );
		}

		final long queryExecutionMillis = elapsedFrom( startTimeNanos );

		if ( queryExecutionMillis > logSlowQuery ) {
			final String sql = statement.toString();
			logSlowQueryInternal( context, queryExecutionMillis, sql );
		}
	}
@Test
	public void testLogSlowQueryFromStatementWhenLoggingEnabled() {
		long logSlowQueryThresholdMillis = 300L;
		SqlStatementLogger sqlStatementLogger = new SqlStatementLogger(
				false,
				false,
				false,
				logSlowQueryThresholdMillis
		);
		AtomicInteger callCounterToString = new AtomicInteger();
		Statement statement = mockStatementForCountingToString( callCounterToString );

		long startTimeNanos = System.nanoTime() - TimeUnit.MILLISECONDS.toNanos( logSlowQueryThresholdMillis + 1 );
		sqlStatementLogger.logSlowQuery( statement, startTimeNanos, null );
		assertEquals( 1, callCounterToString.get() );
	}