averell23-watchdogger 0.1.1 → 0.1.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.
- data/bin/watchdogger +7 -0
- data/lib/dog_log.rb +1 -1
- data/sample_config.yml +2 -2
- metadata +1 -1
data/bin/watchdogger
CHANGED
@@ -25,6 +25,10 @@ module DoggerFlags extend OptiFlagSet
|
|
25
25
|
description 'Get the daemon status'
|
26
26
|
end
|
27
27
|
|
28
|
+
optional_switch_flag 'trace' do
|
29
|
+
description 'Show trace in case of errors.'
|
30
|
+
end
|
31
|
+
|
28
32
|
and_process!
|
29
33
|
end
|
30
34
|
|
@@ -50,5 +54,8 @@ rescue SystemExit
|
|
50
54
|
# nothing
|
51
55
|
rescue Exception => e
|
52
56
|
puts "Problem with this command: #{e.message}. Exiting."
|
57
|
+
if(flags.trace)
|
58
|
+
puts e.backtrace
|
59
|
+
end
|
53
60
|
exit(1)
|
54
61
|
end
|
data/lib/dog_log.rb
CHANGED
@@ -9,7 +9,7 @@ class DogLog # :nodoc:
|
|
9
9
|
# but should not usually be called on an active log.
|
10
10
|
def setup(logfile, severity)
|
11
11
|
@logfile = logfile
|
12
|
-
@severity = severity
|
12
|
+
@severity = Logger.const_get(severity.upcase)
|
13
13
|
if(@logger)
|
14
14
|
assit_fail('Resetting logfile')
|
15
15
|
@logger.close if(@logger.respond_to?(:close))
|
data/sample_config.yml
CHANGED