Class: PGStatusLine

Inherits:
PGLogLine show all
Defined in:
lib/pqa.rb

Overview

Statuses This class is untested please keep ignore = true for the moment

Constant Summary collapse

CONN_RECV =
/connection received: host=([^\s]+) port=([\d]+)/
CONN_AUTH =
/connection authorized: user=([^\s]+) database=([^\s]+)/

Constants inherited from PGLogLine

PGLogLine::DEBUG

Instance Attribute Summary

Attributes inherited from PGLogLine

#cmd_no, #connection_id, #duration, #ignore, #line_no, #text

Instance Method Summary collapse

Methods inherited from PGLogLine

#dump, #initialize, #parse_duration, #to_s

Constructor Details

This class inherits a constructor from PGLogLine

Instance Method Details

#append_to(stream) ⇒ Object



407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/pqa.rb', line 407

def append_to(stream)
  conn_recv = CONN_RECV.match(@text)
  if conn_recv
    stream.set_host_conn!(conn_recv[1], conn_recv[2])
  end

  conn_auth = CONN_AUTH.match(@text)
  if conn_auth
    stream.set_user_db!(conn_auth[1], conn_auth[2])
  end
  return nil  
end