lograge-sql-one-line 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lograge/sql/extension.rb +12 -5
- data/lib/lograge/sql/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 892a353c6624097db9bfdb653ef66dbf7b9e5119
|
4
|
+
data.tar.gz: b284728d7d28b8ecf17df5c80d46a3990fd96d1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6de240a17ef479f80132c83208c2cce7d4e19c2844c1f9374260f413bf0a1cbf80789ba7838f69f06eca25b2c900b390dbc93511377c362ee799d36dfb1cc270
|
7
|
+
data.tar.gz: 2c86a628cd8aa40d67e95bfe32410a6f531e2bf7a22686a2a5b7a89a2e1b9cc32f78e359b5be6066cf2d89516818d5bc86e9390bf207b8ef8363645264bf5a91
|
@@ -2,20 +2,27 @@ module Lograge
|
|
2
2
|
module Sql
|
3
3
|
module Extension
|
4
4
|
def extract_request(event, payload)
|
5
|
-
super.merge!(extract_sql_queries(payload[:uuid]))
|
5
|
+
super.merge!(extract_sql_queries(payload[:uuid], payload[:log_sql]))
|
6
6
|
end
|
7
7
|
|
8
|
-
def extract_sql_queries(uuid)
|
8
|
+
def extract_sql_queries(uuid, log_sql)
|
9
9
|
sql_queries = Thread.current[:lograge_sql_queries]
|
10
10
|
return {} unless sql_queries
|
11
|
+
return {} unless log_sql
|
11
12
|
|
12
13
|
Thread.current[:lograge_sql_queries] = nil
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
formatted_queries = if uuid
|
16
|
+
queries_with_uuid = sql_queries.map do |query|
|
17
|
+
"\n[#{uuid}] #{query}"
|
18
|
+
end
|
19
|
+
|
20
|
+
queries_with_uuid.join
|
21
|
+
else
|
22
|
+
sql_queries.join("\n")
|
16
23
|
end
|
17
24
|
|
18
|
-
{ sql_queries:
|
25
|
+
{ sql_queries: formatted_queries }
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
data/lib/lograge/sql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lograge-sql-one-line
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattia Giuffrida
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lograge
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
127
|
rubyforge_project:
|
128
|
-
rubygems_version: 2.6.
|
128
|
+
rubygems_version: 2.6.14
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: An extension for Lograge to log SQL queries
|