evt-message_store-postgres 0.11.1.3 → 0.11.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7d04b8f2da454ad53aa947dc7df298f1d29311414c8efee0ffd3ac8dc7a2bcb
4
- data.tar.gz: 374897faee72906eadd08403acb3e0492a6de2d9ca92e29c40023fe649022c66
3
+ metadata.gz: 694338b82de9ecf14cd0f86732ea184de0e55dc4549162979d8e7ad25003444d
4
+ data.tar.gz: 25edc8a86ec1d1f58953da6d66e6b4a701ffab939f3d100a6a1ffd93b39a0de0
5
5
  SHA512:
6
- metadata.gz: 0ee9b2b14909d1018ed8bcf0e17d3ce64acef43192c0b8fbd8368a298f3175d0123645608b634df25abd165267924941b322562cad7efa825507c4cb3bb39928
7
- data.tar.gz: 34987b2353309e8cb87d480f108c0a240f7b9fb911de72acd8453a2e47d33083d5960f02e266b88d6db9ce8c20a572c1b66323fabf592ea1c8b337175975b59e
6
+ metadata.gz: 3ffa232583267d460b2b7433dca816ce0e23a58b6f2fddfe2f320fff7de03ddb26b688c4ac86a9b01c454d85f05e863e881f38c50229065d2893d18ffb5da06f
7
+ data.tar.gz: 17ebe30d8c2ecae5a3af452d23311288ccf4cf72c74f923bebe1f18111747e453a49eb4c79b315bbfce439d4dd8bde8fc5e7999e13cf8bf392203b2b0763d5a3
@@ -28,7 +28,9 @@ module MessageStore
28
28
  attr_name ||= :session
29
29
 
30
30
  if session != nil && settings != nil
31
- raise Error, "Session configured with both settings and session arguments. Use one or the other, but not both."
31
+ error_msg = "Session configured with both settings and session arguments. Use one or the other, but not both."
32
+ logger.error(tag: :session) { error_msg }
33
+ raise Error, error_msg
32
34
  end
33
35
 
34
36
  instance = session || build(settings: settings)
@@ -37,18 +39,18 @@ module MessageStore
37
39
  end
38
40
 
39
41
  def open
40
- logger.trace { "Connecting to database" }
42
+ logger.trace(tag: :session) { "Connecting to database" }
41
43
 
42
44
  if connected?
43
- logger.debug { "Already connected. A new connection will not be built." }
45
+ logger.debug(tag: :session) { "Already connected. A new connection will not be built." }
44
46
  return connection
45
47
  end
46
48
 
47
- logger.debug { "Not connected. A new connection will be built." }
49
+ logger.debug(tag: :session) { "Not connected. A new connection will be built." }
48
50
  connection = self.class.build_connection(self)
49
51
  self.connection = connection
50
52
 
51
- logger.debug { "Connected to database" }
53
+ logger.debug(tag: :session) { "Connected to database" }
52
54
 
53
55
  connection
54
56
  end
@@ -56,12 +58,12 @@ module MessageStore
56
58
 
57
59
  def self.build_connection(instance)
58
60
  settings = instance.settings
59
- logger.trace { "Building new connection to database (Settings: #{LogText.settings(settings).inspect})" }
61
+ logger.trace(tag: :session) { "Building new connection to database (Settings: #{LogText.settings(settings).inspect})" }
60
62
 
61
63
  connection = PG::Connection.open(settings)
62
64
  connection.type_map_for_results = PG::BasicTypeMapForResults.new(connection)
63
65
 
64
- logger.trace { "Built new connection to database (Settings: #{LogText.settings(settings).inspect})" }
66
+ logger.debug(tag: :session) { "Built new connection to database (Settings: #{LogText.settings(settings).inspect})" }
65
67
 
66
68
  connection
67
69
  end
@@ -90,7 +92,7 @@ module MessageStore
90
92
  end
91
93
 
92
94
  def execute(sql_command, params=nil)
93
- logger.trace { "Executing SQL command" }
95
+ logger.trace(tag: :session) { "Executing SQL command" }
94
96
  logger.trace(tag: :sql) { sql_command }
95
97
  logger.trace(tag: :data) { params.pretty_inspect }
96
98
 
@@ -100,11 +102,11 @@ module MessageStore
100
102
 
101
103
  if params.nil?
102
104
  connection.exec(sql_command).tap do
103
- logger.debug { "Executed SQL command (no params)" }
105
+ logger.debug(tag: :session) { "Executed SQL command (no params)" }
104
106
  end
105
107
  else
106
108
  connection.exec_params(sql_command, params).tap do
107
- logger.debug { "Executed SQL command with params" }
109
+ logger.debug(tag: :session) { "Executed SQL command with params" }
108
110
  end
109
111
  end
110
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-message_store-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1.3
4
+ version: 0.11.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project