codesake-commons 0.85.0 → 0.89.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
2
  SHA1:
3
- metadata.gz: 45ee0b2bb6bbda3237106c71f4810f5b449cf3df
4
- data.tar.gz: 3116c83b1a4917cb480e44e5b1e2630c31be202b
3
+ metadata.gz: 7328c2346d57c68bc3abe8a58a9dffa6b6b9f7f8
4
+ data.tar.gz: 064907b7e12daa8d415a3f82bd6d034d348314d7
5
5
  SHA512:
6
- metadata.gz: 3a42acfa2e004151437e76bea03220dcd1764d2e609864581c322bf307717700e13071592e8ea2f2a42e4c04f55f85a0612caa1d5761d252699cab918282fa8e
7
- data.tar.gz: eafc1e44e50699a3c705e9c3a9db35b85eb76d919182a331f9fb58774d8197a70bcc4ed99c426f5f788c027431b831e742e902dca321697aeaebbacbffab4fd3
6
+ metadata.gz: 42f8865a54fa068fcfef189956df0c3bfe998d40a8f60512c4cb36da46323c6bdd71cfe223048a7ac22707724ca873755e3d450c9ff441f84864e8a70df45299
7
+ data.tar.gz: 19a6b0a0dc9541733cea36c288406b800cbbbe1b6e82080bcc6792c2212286dbe4120c6b6f93fe428c4da3056f874915eff46b2375a71678029f3038b5a08b8d
@@ -23,7 +23,7 @@ module Codesake
23
23
  end
24
24
 
25
25
  def die(msg, pid_file=nil)
26
- STDERR.print "#{Time.now.strftime("%H:%M:%S")} [!] [#{@component}]: #{msg}\n".color(:red)
26
+ STDERR.print "#{Time.now.strftime("%H:%M:%S")} [!] #{@component}: #{msg}\n".color(:red)
27
27
  send_to_syslog(msg, :helo)
28
28
  send_to_file(msg, :helo)
29
29
  Codesake::Commons::Io.remove_pid_file(pid_file) unless pid_file.nil?
@@ -31,41 +31,40 @@ module Codesake
31
31
  end
32
32
 
33
33
  def err(msg)
34
- STDERR.print "#{Time.now.strftime("%H:%M:%S")} [!] [#{@component}]: #{msg}\n".color(:red)
34
+ STDERR.print "#{Time.now.strftime("%H:%M:%S")} [!] #{@component}: #{msg}\n".color(:red)
35
35
  send_to_syslog(msg, :err)
36
36
  send_to_file(msg, :err)
37
37
  end
38
38
 
39
39
  def warn(msg)
40
- STDOUT.print "#{Time.now.strftime("%H:%M:%S")} [!] [#{@component}]: #{msg}\n".color(:yellow)
40
+ STDOUT.print "#{Time.now.strftime("%H:%M:%S")} [!] #{@component}: #{msg}\n".color(:yellow)
41
41
  send_to_syslog(msg, :warn)
42
42
  send_to_file(msg, :warn)
43
43
  end
44
44
 
45
45
  def ok(msg)
46
- STDOUT.print "#{Time.now.strftime("%H:%M:%S")} [*] [#{@component}]: #{msg}\n".color(:green)
46
+ STDOUT.print "#{Time.now.strftime("%H:%M:%S")} [*] #{@component}: #{msg}\n".color(:green)
47
47
  send_to_syslog(msg, :log)
48
48
  send_to_file(msg, :log)
49
49
  end
50
50
 
51
51
  def log(msg)
52
52
  return if @silencer
53
- STDOUT.print "#{Time.now.strftime("%H:%M:%S")}: [#{@component}]: #{msg}\n".color(:white)
53
+ STDOUT.print "#{Time.now.strftime("%H:%M:%S")} [$] #{@component}: #{msg}\n".color(:white)
54
54
  send_to_syslog(msg, :log)
55
55
  send_to_file(msg, :log)
56
56
  end
57
57
 
58
58
  def helo(component, version, pid_file = nil)
59
59
  @component = component
60
- STDOUT.print "[*] #{@component} v#{version} is starting up at #{Time.now.strftime("%H:%M:%S")}\n".color(:white)
60
+ STDOUT.print "#{Time.now.strftime("%H:%M:%S")} [*] #{@component} v#{version} is starting up\n".color(:white)
61
61
  send_to_syslog("#{@component} v#{version} is starting up", :helo)
62
62
  send_to_file("#{@component} v#{version} is starting up", :helo)
63
63
  Codesake::Commons::Io.create_pid_file(pid_file) unless pid_file.nil?
64
64
  end
65
65
 
66
- def bye(component, version, pid_file = nil)
67
- @component = component
68
- STDOUT.print "[*] #{@component} is leaving at #{Time.now.strftime("%H:%M:%S")}\n".color(:white)
66
+ def bye(pid_file = nil)
67
+ STDOUT.print "#{Time.now.strftime("%H:%M:%S")} [*] #{@component} is leaving\n".color(:white)
69
68
  send_to_syslog("#{@component} is leaving", :helo)
70
69
  send_to_file("#{@component} is leaving", :helo)
71
70
  Codesake::Commons::Io.remove_pid_file(pid_file) unless pid_file.nil?
@@ -1,5 +1,5 @@
1
1
  module Codesake
2
2
  module Commons
3
- VERSION = "0.85.0"
3
+ VERSION = "0.89.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codesake-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.85.0
4
+ version: 0.89.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paolo Perego