8000 Also print outbound MySQL messages · mauricio/postgresql-async@3bf9704 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit 3bf9704

Browse files
committed
Also print outbound MySQL messages
1 parent 53ec23c commit 3bf9704

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.2.11 - 2014-01-11
4+
5+
* Driver logs prepared statement data for PostgreSQL calls when logging is set to debug - #77;
6+
* MySQL and PostgreSQL drivers log network bytes read/written when logging is set to trace;
7+
* PostgreSQL now correctly sends JSON to JSON fields without requiring a cast - #75;
8+
* LocalDateTime is not printed (driver fails silently) - #74;
9+
* Support for ENUM types on PostgreSQL - #75;
10+
* Allow configuring the execution context used by PostgreSQL connections - #72
11+
* Naming executors so we can see the threads created - #71
12+
313
## 0.2.10 - 2013-12-18
414

515
* Removed application_name from PostgreSQL default connection values - #70

mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/codec/MySQLFrameDecoder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class MySQLFrameDecoder(charset: Charset, connectionId : String) extends ByteToM
7777
val slice = buffer.readSlice(size)
7878

7979
if ( log.isTraceEnabled ) {
80-
log.trace(s"Message received is $messageType - " +
80+
log.trace(s"Reading message is $messageType - " +
8181
s"(count=$messagesCount,size=$size,isInQuery=$isInQuery,processingColumns=$processingColumns,processingParams=$processingParams,processedColumns=$processedColumns,processedParams=$processedParams)" +
8282
s 10000 "\n${BufferDumper.dumpAsHex(buffer)}}")
8383
}

mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/codec/MySQLOneToOneEncoder.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import com.github.mauricio.async.db.mysql.binary.BinaryRowEncoder
2121
import com.github.mauricio.async.db.mysql.encoder._
2222
import com.github.mauricio.async.db.mysql.message.client.ClientMessage
2323
import com.github.mauricio.async.db.mysql.util.CharsetMapper
24-
import com.github.mauricio.async.db.util.{ByteBufferUtils, Log}
24+
import com.github.mauricio.async.db.util.{BufferDumper, ByteBufferUtils, Log}
2525
import java.nio.charset.Charset
2626
import scala.annotation.switch
2727
import io.netty.channel.ChannelHandlerContext
@@ -69,14 +69,16 @@ class MySQLOneToOneEncoder(charset: Charset, charsetMapper: CharsetMapper) exten
6969
case _ => throw new EncoderNotAvailableException(message)
7070
}
7171

72-
//log.debug("Writing message {}", message)
73-
7472
val result = encoder.encode(message)
7573

7674
ByteBufferUtils.writePacketLength(result, sequence)
7775

7876
sequence += 1
7977

78+
if ( log.isTraceEnabled ) {
79+
log.trace(s"Writing message ${message.getClass.getName} - \n${BufferDumper.dumpAsHex(result)}")
80+
}
81+
8082
out.add(result)
8183
}
8284
}

postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/codec/MessageEncoder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class MessageEncoder(charset: Charset, encoderRegistry: ColumnEncoderRegistry) e
6363
}
6464

6565
if (log.isTraceEnabled) {
66-
log.trace(s"Message being sent ${msg.getClass.getName}\n${BufferDumper.dumpAsHex(buffer)}")
66+
log.trace(s"Sending message ${msg.getClass.getName}\n${BufferDumper.dumpAsHex(buffer)}")
6767
}
6868

6969
out.add(buffer)

0 commit comments

Comments
 (0)
0