graphql-rails_logger 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c27efe80282ac673fc1bb86bae1072da089ca339
4
- data.tar.gz: f89e30cd78f5ae0cadba8ec329f685d171b220be
2
+ SHA256:
3
+ metadata.gz: 337cf1c56c9d8af5293848d0c76c4f68a24530c4f79f2281764f77023b43d75e
4
+ data.tar.gz: eefac1a1025483b4fef46f848f607eb0254587697939d517fe9e15d930502ea4
5
5
  SHA512:
6
- metadata.gz: d8aaebeca6bef1583a1d62e1dc135b12d6af331258e476ee0260202436e5684dc182726902a4ea229dadf48dc1ebe04554d0096bd60ca767ee83bd46fcee6056
7
- data.tar.gz: 57b157a21b4ee9af0da0a0abaad5ce8fc0e2ce2f7ea9af6fce72da18ac39bbbfa2b192cd4848c6291927f58f2c49df79a0493ce3797a2db5b36f196c7bac9423
6
+ metadata.gz: cc3e0164bb81f82201abfc1f2212f990c1bafa099ff9576bdacccccec079475510cf1418791e60f01e69e6e47a01750889b3d7eb09bc8ff586d61787ce8dcef6
7
+ data.tar.gz: 68fbf61e2a11590a0fda57850f495ec0ccc995097413c7078cdf338b66aa137426376476c0403c89231e2e80f30c64455b1f104398b59e811c9a4e578c4d3238
data/README.md CHANGED
@@ -28,6 +28,7 @@ And then execute:
28
28
  By default this gem formats params only for `GraphqlController#execute`.
29
29
 
30
30
  If you want to change this behaviour, add `config/initializers/graphql_rails_logger.rb` file and set proper controller and actions like this:
31
+
31
32
  ```ruby
32
33
  GraphQL::RailsLogger.configure do |config|
33
34
  config.white_list = {
@@ -44,6 +45,14 @@ GraphQL::RailsLogger.configure do |config|
44
45
  end
45
46
  ```
46
47
 
48
+ The theme can be configured as well. The theme is applied using the [rouge](https://github.com/jneen/rouge) gem, where all available options can be found. The default value is `Rouge::Themes::ThankfulEyes.new`.
49
+
50
+ ```ruby
51
+ GraphQL::RailsLogger.configure do |config|
52
+ config.theme = Rouge::Themes::Pastie.new
53
+ end
54
+ ```
55
+
47
56
  ## Contributing
48
57
 
49
58
  Bug reports and pull requests are welcome on GitHub at https://github.com/jetruby/graphql-rails_logger. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -1,7 +1,9 @@
1
+ require 'rouge'
2
+
1
3
  module GraphQL
2
4
  module RailsLogger
3
5
  class Configuration
4
- attr_accessor :skip_introspection_query, :white_list
6
+ attr_accessor :skip_introspection_query, :white_list, :theme
5
7
 
6
8
  def initialize
7
9
  @skip_introspection_query = nil
@@ -10,6 +12,8 @@ module GraphQL
10
12
  @white_list = {
11
13
  'GraphqlController' => %w[execute]
12
14
  }
15
+
16
+ @theme = Rouge::Themes::ThankfulEyes.new
13
17
  end
14
18
  end
15
19
  end
@@ -30,7 +30,7 @@ module GraphQL
30
30
  info "Processing by #{payload[:controller]}##{payload[:action]} as #{format}"
31
31
 
32
32
  if config.white_list.fetch(payload[:controller], []).include?(payload[:action])
33
- formatter = Rouge::Formatters::Terminal256.new
33
+ formatter = Rouge::Formatters::Terminal256.new(config.theme)
34
34
  query_lexer = Rouge::Lexers::GraphQL.new
35
35
  variables_lexer = Rouge::Lexers::Ruby.new
36
36
 
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module RailsLogger
3
- VERSION = '1.1.0'.freeze
3
+ VERSION = '1.2.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-rails_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JetRuby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2018-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rouge
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.6.11
142
+ rubygems_version: 2.7.3
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Pretty logger for Rails + GraphQL applications.