Skip to content

Commit

Permalink
Merge pull request #83 from dangerousben/feature/logger-namespaces
Browse files Browse the repository at this point in the history
Prepend class name to connection / state machine loggers.
  • Loading branch information
dangerousben authored Sep 18, 2018
2 parents fe28d32 + 229327e commit c6c1e75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.collection.mutable.ListBuffer
*/
class Connection(startState: State = AuthenticationRequired) {
val id = Connection.nextId()
private[this] val logger = Logger(s"connection-$id")
private[this] val logger = Logger(s"${getClass.getName}.connection-$id")
private[this] val stateMachine = new ConnectionStateMachine(startState, id)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.collection.mutable.ListBuffer
* See associated Postgres documentation: http://www.postgresql.org/docs/9.0/static/protocol-flow.html
*/
class ConnectionStateMachine(state: State = AuthenticationRequired, val id: Int) extends StateMachine[Message, PgResponse, State] {
private[this] val logger = Logger(s"psql state machine:$id")
private[this] val logger = Logger(s"${getClass.getName}.psql state machine:$id")

startState(state)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait StateMachine[E, R, S] {

val id: Int

private[this] val logger = Logger(s"state machine-$id")
private[this] val logger = Logger(s"${getClass.getName}.state machine-$id")
private[this] var transitionFunction: Transition = Undefined

@volatile private[this] var currentState: S = _
Expand Down

0 comments on commit c6c1e75

Please sign in to comment.