griffin 0.1.1 → 0.1.2

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
2
  SHA256:
3
- metadata.gz: 79c985d4054a2fc70cc7f1b55041b5c648fb2edc847540ba610bb79ac0f96cb1
4
- data.tar.gz: a3089cfff259dc1a8742ea1e776d4577ca06f4e400e3c2ab9417745b893588e5
3
+ metadata.gz: c1b530676513eca565d67b7f033c68e7fec613b9232bd3cc1f10654c832bcfe0
4
+ data.tar.gz: c14bf3300ef1fd84eb5ecafd7b02d6bf51e7e279f624f1e7a1f35d2dd072e416
5
5
  SHA512:
6
- metadata.gz: 73fa55a2b5fb9dbe1d00829e5add7769cb76ffb03c6d03600c50c9a3d2c2c8465442d80e2f2ed652135cc0a8dad02417e42c6fb1cab0c4d90b98baee9b3261ff
7
- data.tar.gz: 101657f06a41028df869bf0e1aa3e33dd88ced2385554daf82e9c01a7d39479044930026456d9257accb36671393c4d6d7eb4fb8c5ede9394f6acb1d72983ba7
6
+ metadata.gz: 7b1da06d15ca41a14040742dff811b7b37f570a2d0c2951104676618be4063513bcadc610bae082e8662a487a76d6fa41617eb0cf24d64839a2231837d4e10c2
7
+ data.tar.gz: '039db6747145dbf7d9a635a0a2b9909c650af9d5fec03ec8aa0802ce7791390fcf26c89332da3cfa87531b22fd3c22b0712a72d25299972335771778fe0e9ac3'
data/griffin.gemspec CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['ganmacs']
11
11
  spec.email = ['ganmacs@gmail.com']
12
12
 
13
- spec.summary = 'Send and Receive RPCs from Ruby'
14
- spec.description = 'Send and Receive RPCs from Ruby'
13
+ spec.summary = 'gRPC server and client for Ruby'
14
+ spec.description = 'gRPC server and client for Ruby'
15
15
  spec.homepage = 'https://github.com/ganmacs/griffin'
16
16
  spec.license = 'MIT'
17
17
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'serverengine'
4
+ require 'griffin/logger'
4
5
  require 'griffin/engine/single'
5
6
  require 'griffin/engine/server'
6
7
  require 'griffin/engine/worker'
@@ -8,6 +9,8 @@ require 'griffin/engine/worker'
8
9
  module Griffin
9
10
  module Engine
10
11
  def self.start(config, cluster: false)
12
+ Griffin.logger = Griffin::Logger.create(config)
13
+
11
14
  if cluster
12
15
  Griffin.logger.info("Griffin v#{Griffin::VERSION} starts as cluster mode")
13
16
  ServerEngine.create(Griffin::Engine::Server, Griffin::Engine::Worker, config).run
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Griffin
4
+ class Logger
5
+ class << self
6
+ def create(config)
7
+ ServerEngine::DaemonLogger.new(logdev_from_config(config), config)
8
+ end
9
+
10
+ def logdev_from_config(config)
11
+ case c = config[:log]
12
+ when nil # default
13
+ STDERR
14
+ when '-'
15
+ STDOUT
16
+ else
17
+ c
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Griffin
4
4
  class ServerConfigBuilder
5
- SERVERENGINE_PRIMITIVE_CONFIGS = %i[workers bind port log pid_path].freeze
5
+ SERVERENGINE_PRIMITIVE_CONFIGS = %i[workers bind port log pid_path log_level].freeze
6
6
  SERVERENGINE_BLOCK_CONFIGS = %i[before_fork after_fork].freeze
7
7
  # Users can't change these values
8
8
  SERVERENGIEN_FIXED_CONFIGS = %i[daemonize worker_type worker_process_name].freeze
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Griffin
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
data/lib/griffin.rb CHANGED
@@ -10,4 +10,8 @@ module Griffin
10
10
  def self.logger
11
11
  @logger ||= Logger.new(STDOUT, level: :info)
12
12
  end
13
+
14
+ def self.logger=(logger)
15
+ @logger = logger
16
+ end
13
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: griffin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ganmacs
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 2.0.7
111
- description: Send and Receive RPCs from Ruby
111
+ description: gRPC server and client for Ruby
112
112
  email:
113
113
  - ganmacs@gmail.com
114
114
  executables: []
@@ -149,6 +149,7 @@ files:
149
149
  - lib/griffin/engine/single.rb
150
150
  - lib/griffin/engine/worker.rb
151
151
  - lib/griffin/listener.rb
152
+ - lib/griffin/logger.rb
152
153
  - lib/griffin/server.rb
153
154
  - lib/griffin/server_config_builder.rb
154
155
  - lib/griffin/thread_pool.rb
@@ -176,5 +177,5 @@ rubyforge_project:
176
177
  rubygems_version: 2.7.6
177
178
  signing_key:
178
179
  specification_version: 4
179
- summary: Send and Receive RPCs from Ruby
180
+ summary: gRPC server and client for Ruby
180
181
  test_files: []