Skip to content

Restore backwards compatibility in Logger #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void close()
}
catch ( Throwable e )
{
logger.warn( "Failed to close transaction", e );
logger.error( "Failed to close transaction", e );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ public void warn( String message, Object... params )
{
}

@Override
public void warn( String message, Throwable cause )
{
}

@Override
public void debug( String message, Object... params )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ public void warn( String format, Object... params )
delegate.log( Level.WARNING, String.format( format, params ) );
}

@Override
public void warn( String message, Throwable cause )
{
delegate.log( Level.WARNING, message, cause );
}

@Override
public void debug( String format, Object... params )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void stop()
}
else
{
logger.warn( "Unable to close socket connection properly: '" + e.getMessage() + "'", e );
logger.error( "Unable to close socket connection properly", e );
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public <T> T retry( Supplier<T> work )
if ( elapsedTime < maxRetryTimeMs )
{
long delayWithJitterMs = computeDelayWithJitter( nextDelayMs );
log.warn( "Transaction failed and will be retried in " + delayWithJitterMs + "ms", error );
log.error( "Transaction failed and will be retried in " + delayWithJitterMs + "ms", error );

sleep( delayWithJitterMs );
nextDelayMs = (long) (nextDelayMs * multiplier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
import javax.net.ssl.SSLHandshakeException;

import org.neo4j.driver.internal.net.BoltServerAddress;
import org.neo4j.driver.v1.Logger;
import org.neo4j.driver.internal.util.BytePrinter;
import org.neo4j.driver.v1.Logger;
import org.neo4j.driver.v1.exceptions.ClientException;
import org.neo4j.driver.v1.exceptions.ServiceUnavailableException;
import org.neo4j.driver.v1.exceptions.SecurityException;
import org.neo4j.driver.v1.exceptions.ServiceUnavailableException;

import static java.lang.String.format;
import static javax.net.ssl.SSLEngineResult.HandshakeStatus.FINISHED;
Expand Down Expand Up @@ -474,7 +474,7 @@ public void close() throws IOException
catch ( IOException e )
{
// Treat this as ok - the connection is closed, even if the TLS session did not exit cleanly.
logger.warn( "TLS socket could not be closed cleanly: '" + e.getMessage() + "'", e );
logger.error( "TLS socket could not be closed cleanly", e );
}
}

Expand Down
2 changes: 0 additions & 2 deletions driver/src/main/java/org/neo4j/driver/v1/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public interface Logger

void warn( String message, Object... params );

void warn( String message, Throwable cause );

void debug( String message, Object... params );

void trace( String message, Object... params );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public void eachRetryIsLogged()

retry( logic, retries );

verify( logger, times( retries ) ).warn(
verify( logger, times( retries ) ).error(
startsWith( "Transaction failed and will be retried" ),
any( ServiceUnavailableException.class )
);
Expand Down
6 changes: 0 additions & 6 deletions driver/src/test/java/org/neo4j/driver/v1/EventLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@ public void warn( String message, Object... params )
events.log( name, Level.WARN, null, message, params );
}

@Override
public void warn( String message, Throwable cause )
{
events.log( name, Level.WARN, cause, message );
}

@Override
public void debug( String message, Object... params )
{
Expand Down