statscloud 1.2.1 → 1.2.2

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
  SHA1:
3
- metadata.gz: 4b23f5af180e5f89a44cea3f83445ad237129e3f
4
- data.tar.gz: 9d810931633a6d433b04286c787677605be434bb
3
+ metadata.gz: 5aa76b9f5178637642387890a0eea59a27b37f88
4
+ data.tar.gz: ab7290cdc89dcb7ede6ffa90a36dcb96e7329bb9
5
5
  SHA512:
6
- metadata.gz: 4c69cb3d8efad21da05196180598e1a384fb9fbb2f0578381137591993c1e8e407accb6788592140a5158d9c9a46603651478f51731b2b508daacdd0cd0db298
7
- data.tar.gz: cd34dd1491be35442a958e99015d91d410345d0f19968b52e294f415365c370b34f510b656d2dee4c533c86daeb15447d311413db35d1d13cf95e0c4ffe03844
6
+ metadata.gz: 87cf9043f8ba91f9dcd73d3135043b66160851f7b909e2a0b21ff7636dbeb34d99f22aa32bb383d1aa41c1c4af580daa51cf3e327e0113f5a554670f9b448d45
7
+ data.tar.gz: 1f674078a2575818dfbb081415f3c7dc54323d02c6409a7c7b5e33eeb757d3ee468a092b3f452436685ae35619dc50f00a98ce1da1766d0aad48fb1dad535846
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- statscloud (1.2.1)
4
+ statscloud (1.2.2)
5
5
  crc32 (~> 1.0.1)
6
6
  eventmachine (~> 1.2)
7
7
  fileutils
@@ -29,10 +29,10 @@ GEM
29
29
  fileutils (1.1.0)
30
30
  http-cookie (1.0.3)
31
31
  domain_name (~> 0.5)
32
- httparty (0.16.3)
32
+ httparty (0.16.4)
33
33
  mime-types (~> 3.0)
34
34
  multi_xml (>= 0.5.2)
35
- i18n (1.5.2)
35
+ i18n (1.5.3)
36
36
  concurrent-ruby (~> 1.0)
37
37
  jaro_winkler (1.5.2)
38
38
  json (2.1.0)
@@ -6,11 +6,13 @@ module StatsCloud
6
6
  # This helper works to help log errors and info about StatsCloud service work.
7
7
  module LoggerHelper
8
8
  # Log information about work to standard output
9
- def logger(output = default_output)
9
+ def logger(output = default_output, files_to_keep = 10, size_to_age = 1_024_000)
10
10
  file_utils.mkdir_p "log"
11
- @logger ||= logger_service.new(output).tap do |log|
12
- log.progname = "StatsCloud"
13
- end
11
+ @logger ||= create_logger_instance(output, files_to_keep, size_to_age)
12
+ end
13
+
14
+ def console_logger
15
+ @console_logger ||= create_logger_instance(STDOUT)
14
16
  end
15
17
 
16
18
  # Logs information with 10 minutes interval
@@ -55,6 +57,12 @@ module StatsCloud
55
57
  @last_error_log_at = Time.now.to_i
56
58
  end
57
59
 
60
+ def create_logger_instance(output, files_to_keep = nil, size_to_age = nil)
61
+ logger_service.new(output, files_to_keep, size_to_age).tap do |log|
62
+ log.progname = "StatsCloud"
63
+ end
64
+ end
65
+
58
66
  def info_type
59
67
  Logger::INFO
60
68
  end
@@ -65,6 +65,11 @@ module StatsCloud
65
65
  @tags ||= @config["tags"] || [os.gethostname]
66
66
  end
67
67
 
68
+ def log_successful_cluster_deploy
69
+ log_info successful_message
70
+ console_logger.info successful_message
71
+ end
72
+
68
73
  def error(message = error_message)
69
74
  stop
70
75
  statscloud_error(message)
@@ -203,7 +203,7 @@ module StatsCloud
203
203
  @cluster = @cluster_client.get_cluster(@token, @app).body
204
204
  @graphite_url = @cluster["graphiteUrl"]
205
205
  check_cluster_status(@cluster)
206
- log_info successful_message
206
+ log_successful_cluster_deploy
207
207
  end
208
208
 
209
209
  def check_cluster_status(cluster)
@@ -4,5 +4,5 @@ module StatsCloud
4
4
  # version of statscloud-ruby-client.
5
5
  #
6
6
  # Type: *String*
7
- VERSION = "1.2.1"
7
+ VERSION = "1.2.2"
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statscloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Ovcharov