sappho-heatmiser-proxy 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,13 +11,14 @@ module Sappho
11
11
  require 'sappho-heatmiser-proxy/heatmiser_client'
12
12
  require 'sappho-heatmiser-proxy/client_register'
13
13
  require 'sappho-heatmiser-proxy/trace_log'
14
+ require 'sappho-heatmiser-proxy/version'
14
15
  require 'thread'
15
16
  require 'socket'
16
17
 
17
18
  class CommandLine
18
19
 
19
20
  def CommandLine.process
20
- Thread.abort_on_exception = true
21
+ TraceLog.instance.info "#{NAME} version #{VERSION} - #{HOMEPAGE}"
21
22
  Thread.new do
22
23
  clients = ClientRegister.instance
23
24
  port = Integer SystemConfiguration.instance.config['heatmiser.port']
@@ -37,7 +38,9 @@ module Sappho
37
38
  end
38
39
  end
39
40
  end
40
- Thread.new{Heatmiser.new.monitor}.join
41
+ Thread.new do
42
+ Heatmiser.new.monitor
43
+ end.join
41
44
  end
42
45
 
43
46
  end
@@ -10,8 +10,6 @@ module Sappho
10
10
  require 'singleton'
11
11
  require 'thread'
12
12
  require 'logger'
13
- require 'sappho-heatmiser-proxy/system_configuration'
14
- require 'sappho-heatmiser-proxy/version'
15
13
 
16
14
  class TraceLog
17
15
 
@@ -19,21 +17,21 @@ module Sappho
19
17
 
20
18
  def initialize
21
19
  @mutex = Mutex.new
22
- $stdout.sync = true
23
20
  @log = Logger.new $stdout
24
- @log.level = SystemConfiguration.instance.config['log.debug'] ? Logger::DEBUG : Logger::INFO
25
- @log.info "#{NAME} version #{VERSION} - #{HOMEPAGE}"
21
+ @log.level = ENV['heatmiser.log.level'] == 'debug' ? Logger::DEBUG : Logger::INFO
26
22
  end
27
23
 
28
24
  def info message
29
25
  @mutex.synchronize do
30
26
  @log.info message
27
+ $stdout.flush
31
28
  end if @log.info?
32
29
  end
33
30
 
34
31
  def debug message
35
32
  @mutex.synchronize do
36
33
  @log.debug message
34
+ $stdout.flush
37
35
  end if @log.debug?
38
36
  end
39
37
 
@@ -41,6 +39,7 @@ module Sappho
41
39
  @mutex.synchronize do
42
40
  @log.error "error! #{error.message}"
43
41
  error.backtrace.each { |error| @log.error error }
42
+ $stdout.flush
44
43
  end if @log.error?
45
44
  end
46
45
 
@@ -7,7 +7,7 @@ module Sappho
7
7
  module Heatmiser
8
8
  module Proxy
9
9
  NAME = "sappho-heatmiser-proxy"
10
- VERSION = "0.0.3"
10
+ VERSION = "0.0.4"
11
11
  AUTHORS = ["Andrew Heald"]
12
12
  EMAILS = ["andrew@heald.co.uk"]
13
13
  HOMEPAGE = "https://github.com/sappho/sappho-heatmiser-proxy/wiki"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sappho-heatmiser-proxy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrew Heald