gorgon 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +0 -2
  3. data/.rspec +2 -0
  4. data/.travis.yml +10 -0
  5. data/Dockerfile +25 -0
  6. data/Gemfile.lock +20 -15
  7. data/README.md +33 -6
  8. data/Rakefile +5 -0
  9. data/architecture.md +2 -2
  10. data/bin/gorgon +2 -114
  11. data/daemon_with_upstart_and_rvm.md +1 -1
  12. data/docker-compose.yml +28 -0
  13. data/file_server/Dockerfile +8 -0
  14. data/file_server/test_gorgon.pem.pub +1 -0
  15. data/gorgon.gemspec +2 -2
  16. data/gorgon_secret.json.sample +5 -0
  17. data/lib/gorgon/amqp_service.rb +28 -26
  18. data/lib/gorgon/callback_handler.rb +28 -26
  19. data/lib/gorgon/colors.rb +6 -4
  20. data/lib/gorgon/command.rb +145 -0
  21. data/lib/gorgon/configuration.rb +45 -5
  22. data/lib/gorgon/core_ext/hash/deep_merge.rb +21 -0
  23. data/lib/gorgon/crash_reporter.rb +15 -13
  24. data/lib/gorgon/failures_printer.rb +27 -26
  25. data/lib/gorgon/g_logger.rb +19 -17
  26. data/lib/gorgon/gem_command_handler.rb +41 -39
  27. data/lib/gorgon/gem_service.rb +60 -57
  28. data/lib/gorgon/host_state.rb +23 -21
  29. data/lib/gorgon/job.rb +19 -17
  30. data/lib/gorgon/job_definition.rb +23 -21
  31. data/lib/gorgon/job_state.rb +93 -90
  32. data/lib/gorgon/listener.rb +137 -146
  33. data/lib/gorgon/listener_installer.rb +98 -96
  34. data/lib/gorgon/originator.rb +170 -167
  35. data/lib/gorgon/originator_logger.rb +30 -28
  36. data/lib/gorgon/originator_protocol.rb +85 -83
  37. data/lib/gorgon/ping_service.rb +44 -42
  38. data/lib/gorgon/pipe_forker.rb +17 -15
  39. data/lib/gorgon/progress_bar_view.rb +109 -107
  40. data/lib/gorgon/rsync_daemon.rb +56 -54
  41. data/lib/gorgon/runtime_file_reader.rb +28 -27
  42. data/lib/gorgon/runtime_recorder.rb +27 -26
  43. data/lib/gorgon/settings/files_content.rb +27 -25
  44. data/lib/gorgon/settings/initial_files_creator.rb +58 -56
  45. data/lib/gorgon/settings/rails_project_files_content.rb +33 -31
  46. data/lib/gorgon/settings/simple_project_files_content.rb +11 -9
  47. data/lib/gorgon/shutdown_manager.rb +20 -18
  48. data/lib/gorgon/source_tree_syncer.rb +108 -69
  49. data/lib/gorgon/version.rb +1 -1
  50. data/lib/gorgon/worker.rb +130 -128
  51. data/lib/gorgon/worker_manager.rb +139 -137
  52. data/lib/gorgon_amq-protocol/.rspec +3 -0
  53. data/run_dev_environment.sh +3 -0
  54. data/run_gorgon.sh +3 -0
  55. data/run_listener.sh +3 -0
  56. data/run_test.sh +3 -0
  57. data/spec/callback_handler_spec.rb +10 -10
  58. data/spec/command_spec.rb +172 -0
  59. data/spec/configuration_spec.rb +62 -0
  60. data/spec/core_ext/hash/deep_merge_spec.rb +11 -0
  61. data/spec/crash_reporter_spec.rb +10 -10
  62. data/spec/dummy/.gitignore +3 -0
  63. data/spec/dummy/Gemfile +11 -0
  64. data/spec/dummy/Gemfile.lock +76 -0
  65. data/spec/dummy/README.md +23 -0
  66. data/spec/dummy/gorgon.json +30 -0
  67. data/spec/dummy/gorgon_callbacks.rb +68 -0
  68. data/spec/dummy/gorgon_listener.json +8 -0
  69. data/spec/dummy/integration_spec.rb +51 -0
  70. data/spec/{support/mock_app/app/mailers → dummy/log}/.gitkeep +0 -0
  71. data/spec/dummy/rspec_runner.rb +8 -0
  72. data/spec/dummy/spec/1_syntax_error_spec.rb +1 -0
  73. data/spec/dummy/spec/exception_spec.rb +5 -0
  74. data/spec/dummy/spec/failing_spec.rb +11 -0
  75. data/spec/dummy/spec/keeping_rspec_config_spec.rb +5 -0
  76. data/spec/dummy/spec/spec_helper.rb +13 -0
  77. data/spec/dummy/spec/successful_spec.rb +9 -0
  78. data/spec/dummy/spec/using_shared_example_spec.rb +3 -0
  79. data/spec/dummy/test/.rb +15 -0
  80. data/spec/dummy/test/minitest/mini1_test.rb +11 -0
  81. data/spec/dummy/test/minitest/mini2_test.rb +25 -0
  82. data/spec/dummy/test/unit/1_syntax_error_test.rb +9 -0
  83. data/spec/dummy/test/unit/exception_test.rb +14 -0
  84. data/spec/dummy/test/unit/failing_test.rb +17 -0
  85. data/spec/dummy/test/unit/successful_test.rb +9 -0
  86. data/spec/dummy/test_gorgon.pem +27 -0
  87. data/spec/end_to_end_spec.rb +142 -0
  88. data/spec/failures_printer_spec.rb +20 -20
  89. data/spec/gem_command_handler_spec.rb +24 -24
  90. data/spec/gem_service_spec.rb +18 -18
  91. data/spec/gorgon_rspec_formatter_spec.rb +12 -12
  92. data/spec/host_state_spec.rb +8 -8
  93. data/spec/job_definition_spec.rb +3 -3
  94. data/spec/job_state_spec.rb +46 -46
  95. data/spec/listener_spec.rb +67 -73
  96. data/spec/mini_test_runner_spec.rb +7 -7
  97. data/spec/originator_logger_spec.rb +6 -6
  98. data/spec/originator_protocol_spec.rb +38 -38
  99. data/spec/originator_spec.rb +78 -69
  100. data/spec/ping_service_spec.rb +14 -14
  101. data/spec/pipe_forker_spec.rb +13 -13
  102. data/spec/progress_bar_view_spec.rb +32 -32
  103. data/spec/rspec_runner_spec.rb +12 -12
  104. data/spec/rsync_daemon_spec.rb +18 -16
  105. data/spec/runtime_file_reader_spec.rb +12 -12
  106. data/spec/runtime_recorder_spec.rb +19 -19
  107. data/spec/shutdown_manager_spec.rb +9 -9
  108. data/spec/source_tree_syncer_spec.rb +148 -61
  109. data/spec/spec_helper.rb +3 -0
  110. data/spec/support/end_to_end_helpers.rb +16 -0
  111. data/spec/support/stream_helpers.rb +23 -0
  112. data/spec/unknown_runner_spec.rb +1 -1
  113. data/spec/worker_manager_spec.rb +23 -23
  114. data/spec/worker_spec.rb +70 -70
  115. metadata +84 -113
  116. data/spec/acceptance_spec_helper.rb +0 -7
  117. data/spec/support/mock_app/.gitignore +0 -15
  118. data/spec/support/mock_app/Gemfile +0 -39
  119. data/spec/support/mock_app/Gemfile.lock +0 -135
  120. data/spec/support/mock_app/README.rdoc +0 -261
  121. data/spec/support/mock_app/Rakefile +0 -7
  122. data/spec/support/mock_app/app/assets/images/rails.png +0 -0
  123. data/spec/support/mock_app/app/assets/javascripts/application.js +0 -15
  124. data/spec/support/mock_app/app/assets/stylesheets/application.css +0 -13
  125. data/spec/support/mock_app/app/controllers/application_controller.rb +0 -3
  126. data/spec/support/mock_app/app/helpers/application_helper.rb +0 -2
  127. data/spec/support/mock_app/app/models/.gitkeep +0 -0
  128. data/spec/support/mock_app/app/views/layouts/application.html.erb +0 -14
  129. data/spec/support/mock_app/config.ru +0 -4
  130. data/spec/support/mock_app/config/application.rb +0 -62
  131. data/spec/support/mock_app/config/boot.rb +0 -6
  132. data/spec/support/mock_app/config/database.yml +0 -25
  133. data/spec/support/mock_app/config/environment.rb +0 -5
  134. data/spec/support/mock_app/config/environments/development.rb +0 -37
  135. data/spec/support/mock_app/config/environments/production.rb +0 -67
  136. data/spec/support/mock_app/config/environments/test.rb +0 -37
  137. data/spec/support/mock_app/config/initializers/backtrace_silencers.rb +0 -7
  138. data/spec/support/mock_app/config/initializers/inflections.rb +0 -15
  139. data/spec/support/mock_app/config/initializers/mime_types.rb +0 -5
  140. data/spec/support/mock_app/config/initializers/secret_token.rb +0 -7
  141. data/spec/support/mock_app/config/initializers/session_store.rb +0 -8
  142. data/spec/support/mock_app/config/initializers/wrap_parameters.rb +0 -14
  143. data/spec/support/mock_app/config/locales/en.yml +0 -5
  144. data/spec/support/mock_app/config/routes.rb +0 -58
  145. data/spec/support/mock_app/db/seeds.rb +0 -7
  146. data/spec/support/mock_app/doc/README_FOR_APP +0 -2
  147. data/spec/support/mock_app/lib/assets/.gitkeep +0 -0
  148. data/spec/support/mock_app/lib/tasks/.gitkeep +0 -0
  149. data/spec/support/mock_app/log/.gitkeep +0 -0
  150. data/spec/support/mock_app/public/404.html +0 -26
  151. data/spec/support/mock_app/public/422.html +0 -26
  152. data/spec/support/mock_app/public/500.html +0 -25
  153. data/spec/support/mock_app/public/favicon.ico +0 -0
  154. data/spec/support/mock_app/public/index.html +0 -241
  155. data/spec/support/mock_app/public/robots.txt +0 -5
  156. data/spec/support/mock_app/script/rails +0 -6
  157. data/spec/support/mock_app/test/fixtures/.gitkeep +0 -0
  158. data/spec/support/mock_app/test/functional/.gitkeep +0 -0
  159. data/spec/support/mock_app/test/integration/.gitkeep +0 -0
  160. data/spec/support/mock_app/test/performance/browsing_test.rb +0 -12
  161. data/spec/support/mock_app/test/test_helper.rb +0 -13
  162. data/spec/support/mock_app/test/unit/.gitkeep +0 -0
  163. data/spec/support/mock_app/test/unit/passing_test.rb +0 -7
  164. data/spec/support/mock_app/vendor/assets/javascripts/.gitkeep +0 -0
  165. data/spec/support/mock_app/vendor/assets/stylesheets/.gitkeep +0 -0
  166. data/spec/support/mock_app/vendor/plugins/.gitkeep +0 -0
  167. data/spec/support/originator_handler.rb +0 -8
@@ -1,35 +1,37 @@
1
- class CallbackHandler
2
- def initialize(config)
3
- @config = config || {}
4
- load(@config[:callbacks_class_file]) if @config[:callbacks_class_file]
5
- end
1
+ module Gorgon
2
+ class CallbackHandler
3
+ def initialize(config)
4
+ @config = config || {}
5
+ load(@config[:callbacks_class_file]) if @config[:callbacks_class_file]
6
+ end
6
7
 
7
- def before_originate
8
- cluster_id = Gorgon.callbacks.before_originate
9
- return cluster_id if cluster_id.is_a?(String)
10
- end
8
+ def before_originate
9
+ cluster_id = Gorgon.callbacks.before_originate
10
+ return cluster_id if cluster_id.is_a?(String)
11
+ end
11
12
 
12
- def after_sync
13
- Gorgon.callbacks.after_sync
14
- end
13
+ def after_sync
14
+ Gorgon.callbacks.after_sync
15
+ end
15
16
 
16
- def before_creating_workers
17
- Gorgon.callbacks.before_creating_workers
18
- end
17
+ def before_creating_workers
18
+ Gorgon.callbacks.before_creating_workers
19
+ end
19
20
 
20
- def before_start
21
- Gorgon.callbacks.before_start
22
- end
21
+ def before_start
22
+ Gorgon.callbacks.before_start
23
+ end
23
24
 
24
- def after_creating_workers
25
- Gorgon.callbacks.after_creating_workers
26
- end
25
+ def after_creating_workers
26
+ Gorgon.callbacks.after_creating_workers
27
+ end
27
28
 
28
- def after_complete
29
- Gorgon.callbacks.after_complete
30
- end
29
+ def after_complete
30
+ Gorgon.callbacks.after_complete
31
+ end
31
32
 
32
- def after_job_finishes
33
- Gorgon.callbacks.after_job_finishes
33
+ def after_job_finishes
34
+ Gorgon.callbacks.after_job_finishes
35
+ end
34
36
  end
35
37
  end
@@ -1,5 +1,7 @@
1
- module Colors
2
- FILENAME = :light_cyan
3
- HOST = :light_blue
4
- COMMAND = :yellow
1
+ module Gorgon
2
+ module Colors
3
+ FILENAME = :light_cyan
4
+ HOST = :light_blue
5
+ COMMAND = :yellow
6
+ end
5
7
  end
@@ -0,0 +1,145 @@
1
+ require "rubygems"
2
+ require 'gorgon'
3
+ require 'gorgon/originator'
4
+ require 'gorgon/listener'
5
+ require 'gorgon/rsync_daemon'
6
+ require 'gorgon/worker_manager'
7
+ require 'gorgon/ping_service'
8
+ require 'gorgon/gem_service'
9
+ require 'gorgon/version'
10
+ require 'gorgon/listener_installer'
11
+ require 'gorgon/settings/initial_files_creator'
12
+
13
+ module Gorgon
14
+ class Command
15
+ WELCOME_MESSAGE = "Welcome to Gorgon #{Gorgon::VERSION}"
16
+ USAGE = <<-EOT
17
+ USAGE: gorgon <command> [<args>]
18
+
19
+ COMMANDS:
20
+ start remotely run all tests specified in gorgon.json
21
+ listen start a listener process using the settings in gorgon_listener.json
22
+ ping ping listeners and show hosts and gorgon's version they are running
23
+ init [<framework>] create initial files for current project
24
+ install_listener run gorgon listener as a daemon process
25
+ start_rsync <directory> start rsync daemon. Run this command in File Server
26
+ stop_rsync stop rsync daemon.
27
+ gem command [<options>...] execute the gem command on every listener and shutdown listener.
28
+ (e.g. 'gorgon gem install bunny --version 1.0.0')
29
+
30
+ OPTIONS:
31
+ -h, --help print this message
32
+ -v, --version print gorgon version
33
+ EOT
34
+
35
+ COMMAND_WHITELIST = %w(help version start listen start_rsync stop_rsync manage_workers ping gem init install_listener)
36
+
37
+ attr_reader :argv
38
+
39
+ def initialize(argv)
40
+ if argv.empty?
41
+ @argv = ['start']
42
+ else
43
+ @argv = argv
44
+ end
45
+ end
46
+
47
+ def self.run(argv = ARGV)
48
+ new(argv).run_command
49
+ end
50
+
51
+ def run_command
52
+ command = parse(argv.shift)
53
+ if COMMAND_WHITELIST.include?(command)
54
+ puts WELCOME_MESSAGE unless ['version', 'help'].include?(command)
55
+ send(command)
56
+ else
57
+ write_error_message(command)
58
+ end
59
+ end
60
+
61
+ def help
62
+ write_usage
63
+ exit(0)
64
+ end
65
+
66
+ def version
67
+ puts Gorgon::VERSION
68
+ exit(0)
69
+ end
70
+
71
+ def start
72
+ o = Originator.new
73
+ exit o.originate
74
+ end
75
+
76
+ def listen
77
+ l = Listener.new
78
+ l.listen
79
+ end
80
+
81
+ def start_rsync
82
+ puts "Starting rsync daemon..."
83
+ directory = argv[0]
84
+ exit 1 unless RsyncDaemon.start directory
85
+ puts "Rsync Daemon is running. Use 'gorgon stop_rsync' to kill it."
86
+ end
87
+
88
+ def stop_rsync
89
+ puts "Stopping rsync daemon..."
90
+ exit 1 unless RsyncDaemon.stop
91
+ puts "Done"
92
+ end
93
+
94
+ def manage_workers
95
+ config_path = ENV["GORGON_CONFIG_PATH"]
96
+
97
+ manager = WorkerManager.build config_path
98
+ manager.manage
99
+
100
+ # For some reason I have to 'exit' here, otherwise WorkerManager process crashes
101
+ exit
102
+ end
103
+
104
+ def ping
105
+ PingService.new.ping_listeners
106
+ end
107
+
108
+ def gem
109
+ gem_opts = argv.join(" ")
110
+ GemService.new.run(gem_opts)
111
+ end
112
+
113
+ def init
114
+ framework = argv[0]
115
+ Settings::InitialFilesCreator.run(framework)
116
+ end
117
+
118
+ def install_listener
119
+ ListenerInstaller.install
120
+ end
121
+
122
+ private
123
+
124
+ def write_usage
125
+ puts USAGE
126
+ end
127
+
128
+ def parse(command)
129
+ case command
130
+ when '--version', '-v'
131
+ 'version'
132
+ when 'help', '--help', '-h'
133
+ 'help'
134
+ else
135
+ command
136
+ end
137
+ end
138
+
139
+ def write_error_message(command)
140
+ puts "Error: Command '#{command}' not recognized"
141
+ write_usage
142
+ exit(1)
143
+ end
144
+ end
145
+ end
@@ -1,9 +1,49 @@
1
+ require "gorgon/core_ext/hash/deep_merge"
1
2
  require "yajl"
2
3
 
3
- module Configuration
4
- extend self
5
- def load_configuration_from_file(filename)
6
- file = File.new(filename, "r")
7
- Yajl::Parser.new(:symbolize_keys => true).parse(file)
4
+ module Gorgon
5
+ module Configuration
6
+ extend self
7
+
8
+ def load_configuration_from_file(first_filename, merge: nil, file_loader: FileLoader)
9
+ ConfigurationParser.new(
10
+ file_loader: file_loader
11
+ ).load_from_files(
12
+ first_filename: first_filename,
13
+ merge_filename: merge
14
+ )
15
+ end
16
+
17
+ class ConfigurationParser
18
+ def initialize(file_loader:)
19
+ @file_loader = file_loader
20
+ end
21
+
22
+ def load_from_files(first_filename:, merge_filename:)
23
+ if merge_filename && @file_loader.exists?(merge_filename)
24
+ load_file(first_filename).deep_merge(load_file(merge_filename))
25
+ else
26
+ load_file(first_filename)
27
+ end
28
+ end
29
+
30
+ private
31
+
32
+ def load_file(filename)
33
+ @file_loader.parse(filename)
34
+ end
35
+ end
36
+
37
+ module FileLoader
38
+ def self.parse(filename)
39
+ file = File.new(filename, "r")
40
+ Yajl::Parser.new(symbolize_keys: true).parse(file)
41
+ end
42
+
43
+ def self.exists?(filename)
44
+ File.exists?(filename)
45
+ end
46
+ end
8
47
  end
9
48
  end
49
+
@@ -0,0 +1,21 @@
1
+ # Algorithm from 'activesupport/core_ext/hash/deep_merge'
2
+
3
+ class Hash
4
+ def deep_merge(other_hash)
5
+ dup.deep_merge!(other_hash)
6
+ end
7
+
8
+ def deep_merge!(other_hash)
9
+ other_hash.each_pair do |current_key, other_value|
10
+ this_value = self[current_key]
11
+
12
+ self[current_key] = if this_value.is_a?(Hash) && other_value.is_a?(Hash)
13
+ this_value.deep_merge(other_value)
14
+ else
15
+ other_value
16
+ end
17
+ end
18
+
19
+ self
20
+ end
21
+ end
@@ -1,19 +1,21 @@
1
- module CrashReporter
2
- OUTPUT_LINES_TO_REPORT = 70
1
+ module Gorgon
2
+ module CrashReporter
3
+ OUTPUT_LINES_TO_REPORT = 70
3
4
 
4
- def report_crash reply_exchange, info
5
- stdout = `tail -n #{OUTPUT_LINES_TO_REPORT} #{info[:out_file]}`
6
- stderr = `cat #{info[:err_file]}` + \
7
- info[:footer_text]
5
+ def report_crash reply_exchange, info
6
+ stdout = `tail -n #{OUTPUT_LINES_TO_REPORT} #{info[:out_file]}`
7
+ stderr = `cat #{info[:err_file]}` + \
8
+ info[:footer_text]
8
9
 
9
- send_crash_message reply_exchange, stdout, stderr
10
+ send_crash_message reply_exchange, stdout, stderr
10
11
 
11
- "#{stdout}\n#{stderr}"
12
- end
12
+ "#{stdout}\n#{stderr}"
13
+ end
13
14
 
14
- def send_crash_message reply_exchange, output, error
15
- reply = {:type => :crash, :hostname => Socket.gethostname,
16
- :stdout => output, :stderr => error}
17
- reply_exchange.publish(Yajl::Encoder.encode(reply))
15
+ def send_crash_message reply_exchange, output, error
16
+ reply = {:type => :crash, :hostname => Socket.gethostname,
17
+ :stdout => output, :stderr => error}
18
+ reply_exchange.publish(Yajl::Encoder.encode(reply))
19
+ end
18
20
  end
19
21
  end
@@ -1,40 +1,41 @@
1
1
  require 'yajl'
2
2
 
3
- class FailuresPrinter
4
- DEFAULT_OUTPUT_FILE = "/tmp/gorgon-failed-files.json"
3
+ module Gorgon
4
+ class FailuresPrinter
5
+ DEFAULT_OUTPUT_FILE = "/tmp/gorgon-failed-files.json"
5
6
 
6
- attr_reader :output_file
7
+ attr_reader :output_file
7
8
 
8
- def initialize(configuration, job_state)
9
- @job_state = job_state
10
- @job_state.add_observer(self)
11
- @output_file = configuration.fetch(:failed_files) { DEFAULT_OUTPUT_FILE }
12
- end
9
+ def initialize(configuration, job_state)
10
+ @job_state = job_state
11
+ @job_state.add_observer(self)
12
+ @output_file = configuration.fetch(:failed_files) { DEFAULT_OUTPUT_FILE }
13
+ end
13
14
 
14
- def update payload
15
- return unless @job_state.is_job_complete? || @job_state.is_job_cancelled?
15
+ def update payload
16
+ return unless @job_state.is_job_complete? || @job_state.is_job_cancelled?
16
17
 
17
- File.open(@output_file, 'w+') do |fd|
18
- fd.write(Yajl::Encoder.encode(failed_files + unfinished_files))
18
+ File.open(@output_file, 'w+') do |fd|
19
+ fd.write(Yajl::Encoder.encode(failed_files + unfinished_files))
20
+ end
19
21
  end
20
- end
21
22
 
22
- private
23
+ private
23
24
 
24
- def failed_files
25
- failed_files = []
26
- @job_state.each_failed_test do |test|
27
- failed_files << "#{test[:filename]}"
25
+ def failed_files
26
+ failed_files = []
27
+ @job_state.each_failed_test do |test|
28
+ failed_files << "#{test[:filename]}"
29
+ end
30
+ failed_files
28
31
  end
29
- failed_files
30
- end
31
32
 
32
- def unfinished_files
33
- unfinished_files = []
34
- @job_state.each_running_file do |hostname, filename|
35
- unfinished_files << "#{filename}"
33
+ def unfinished_files
34
+ unfinished_files = []
35
+ @job_state.each_running_file do |hostname, filename|
36
+ unfinished_files << "#{filename}"
37
+ end
38
+ unfinished_files
36
39
  end
37
- unfinished_files
38
40
  end
39
41
  end
40
-
@@ -1,24 +1,26 @@
1
1
  require "logger"
2
2
 
3
- module GLogger
4
- SIZE_1_MB = 1048576
3
+ module Gorgon
4
+ module GLogger
5
+ SIZE_1_MB = 1048576
5
6
 
6
- def initialize_logger log_file
7
- return unless log_file
8
- @logger =
9
- if log_file == "-"
10
- Logger.new($stdout)
11
- else
12
- Logger.new(log_file, 1, SIZE_1_MB)
13
- end
14
- @logger.datetime_format = "%Y-%m-%d %H:%M:%S "
15
- end
7
+ def initialize_logger log_file
8
+ return unless log_file
9
+ @logger =
10
+ if log_file == "-"
11
+ Logger.new($stdout)
12
+ else
13
+ Logger.new(log_file, 1, SIZE_1_MB)
14
+ end
15
+ @logger.datetime_format = "%Y-%m-%d %H:%M:%S "
16
+ end
16
17
 
17
- def log text
18
- @logger.info(text) if @logger
19
- end
18
+ def log text
19
+ @logger.info(text) if @logger
20
+ end
20
21
 
21
- def log_error text
22
- @logger.error(text) if @logger
22
+ def log_error text
23
+ @logger.error(text) if @logger
24
+ end
23
25
  end
24
26
  end