log_error_handler 0.1.0 → 0.1.1

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: 1aec30724757e1105c92482736908fc96ce99d1e
4
- data.tar.gz: d6b9aa4f31ac86d2ec87fd38638a09aee104922b
3
+ metadata.gz: 73d834422224b75eca855fc6508be40a1f24aa3a
4
+ data.tar.gz: 4a8923b446f270bedd70471880379f2d61739338
5
5
  SHA512:
6
- metadata.gz: 82311d2f84ba62d7f1e658dd5d3fe9d13d552e9e3d705ab80a9c055039a0ea0f2f5ef67115146265bb05011d2bfa4678682b885a846187c05af066c01e5bf121
7
- data.tar.gz: 0079d04ef4423ddd5b67a8162209b4f5a43f3b7f87415cdfcfc99a495133d451a83387481c185fef23678e2ff5b6ee0b9db05d6a8401db279aafe08d1d87e31e
6
+ metadata.gz: 213d9847baf05db31d49a9f51a1fc13b4a43ef5a3794d910f2ecc804ee4f50c5fcbd55a9e97c41e7c5c0bab50973e37d6302011e92acc0904369828c637eb7c9
7
+ data.tar.gz: 16ea0f664c918e414f4a4e2e53dfa0232114c67d01d1bfd61d0489ffe282bdafd50713af90fc411f81fb1b9d52ed34cf64ebf4b9e2a7ce0fab03ded8144f8371
@@ -59,6 +59,10 @@ OptionParser.new do |opts|
59
59
  options[:error_message_key] = key
60
60
  end
61
61
 
62
+ opts.on('--debug_mode', 'Puts logs to standard stdout') do
63
+ options[:debug_mode] = true
64
+ end
65
+
62
66
  opts.on('-d', '--daemonize', 'Daemonize') do
63
67
  Process.daemon(true, true)
64
68
  end
@@ -24,6 +24,7 @@ module LogErrorHandler
24
24
 
25
25
  @tracker.mutex.lock
26
26
  @tracker.tracking_logs.each do |key, value|
27
+ $stdout.puts "\n\nCheck file: #{key}. Status: #{value[:status]}\n\n" if @tracker.options[:debug_mode]
27
28
  next if Time.now.to_i - value[:timestamp] <= @tracker.options[:not_modify_timeout]
28
29
  if value[:status] == :error
29
30
  value[:file].rewind
@@ -33,6 +33,7 @@ module LogErrorHandler
33
33
  @tracker.mutex.unlock
34
34
 
35
35
  text = line.sub(@tracker.options[:tid_regexp], '')
36
+ $stdout.puts "#{@last_tid}: #{text}" if @tracker.options[:debug_mode]
36
37
  @tracker.tracking_logs[@last_tid][:file].write(text)
37
38
  @tracker.tracking_logs[@last_tid][:status] = :error if text[@tracker.options[:error_regexp]]
38
39
  @tracker.tracking_logs[@last_tid][:timestamp] = Time.now.to_i
@@ -1,3 +1,3 @@
1
1
  module LogErrorHandler
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_error_handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thinkmobiles