evt-log 0.5.0.0 → 0.5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/log/filter.rb +4 -0
  3. data/lib/log/format.rb +16 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aea91ca5533a3ac1adeaeb1fb8a896058ce379c54878b630fd635a17e2757705
4
- data.tar.gz: 4866f0db99d5035dff9f305efb61c1a50760f998ea351ad460158aca6abdbbef
3
+ metadata.gz: fb86e203c364fba2883aecb5550afb68cafd0e85b0ace908e88022acf214560b
4
+ data.tar.gz: aea017040fe5e881d2a2e4ab241acf493bf9db1e1ec7f1e097e45fcc0383a085
5
5
  SHA512:
6
- metadata.gz: ebf2765c97c9831c79137a03aa8c9567ac9dec3720c3ccb831f78c4dce98f8262c6443815b28ac57d47c7d45008e4de8f339c198b3c1484f12127c2b1a8fbd5a
7
- data.tar.gz: 96110e9ff8e5f4153c254a3d2510ed65a2e8b1d08411dd033fa6724aaccb9f6703c93dc353c8a4f9e3e1815485c35fcb38b73eeca8b5acdc771ce039aecb2bcb
6
+ metadata.gz: eb6b43807b64e8a7dd260019bd4acd7a4b813f53f0642aa9f987a158741185f71d93d8e69b5e5cdc98a4879d79e8f803b23773253275be5629ed18da5422fd33
7
+ data.tar.gz: 0e006cd4429f4adf79b495fdf576e0547eb91d9cafc617ae206028e9c8365f250b808b4fba257e4a665ce1f97fee9cbf10c90bd94d143bee3592ce9adbc8de8a
@@ -23,6 +23,10 @@ class Log
23
23
  return true
24
24
  end
25
25
 
26
+ if message_tags.include?(:*)
27
+ return true
28
+ end
29
+
26
30
  if log_all_tags?
27
31
  return true
28
32
  end
@@ -1,7 +1,12 @@
1
1
  class Log
2
2
  module Format
3
3
  def self.line(message, time, subject, level, device, &message_formatter)
4
- "#{header(time, subject, level, device)} #{message(message, device, &message_formatter)}"
4
+ header = nil
5
+ if Defaults.header == :on
6
+ header = "#{header(time, subject, level, device)} "
7
+ end
8
+
9
+ "#{header}#{message(message, device, &message_formatter)}"
5
10
  end
6
11
 
7
12
  def self.message(message, device, &message_formatter)
@@ -26,6 +31,16 @@ class Log
26
31
  def self.message_formatter
27
32
  proc {|message| message }
28
33
  end
34
+
35
+ def self.header
36
+ env_header = ENV['LOG_HEADER']
37
+
38
+ if env_header.nil?
39
+ env_header = :on
40
+ end
41
+
42
+ env_header.to_sym
43
+ end
29
44
  end
30
45
  end
31
46
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.0
4
+ version: 0.5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-14 00:00:00.000000000 Z
11
+ date: 2018-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-initializer