codesake-commons 0.85.0 → 0.89.0
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 +4 -4
- data/lib/codesake/commons/logging.rb +8 -9
- data/lib/codesake/commons/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7328c2346d57c68bc3abe8a58a9dffa6b6b9f7f8
|
4
|
+
data.tar.gz: 064907b7e12daa8d415a3f82bd6d034d348314d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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")} [!]
|
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")} [!]
|
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")} [!]
|
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")} [*]
|
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")}
|
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
|
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(
|
67
|
-
@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?
|