common_event_formatter 0.1.2 → 0.1.3

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.
Files changed (2) hide show
  1. data/lib/common_event_formatter.rb +3 -3
  2. metadata +1 -1
@@ -2,7 +2,7 @@ require "logger"
2
2
  require "json"
3
3
 
4
4
  class CommonEventFormatter < Logger::Formatter
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
 
7
7
  def call(severity, time, progname, msg)
8
8
  create_event({:level => severity, :time => time, :host => hostname, :app => pwd, :pname => (progname || $0), :msg => msg2str(msg)})
@@ -14,7 +14,7 @@ class CommonEventFormatter < Logger::Formatter
14
14
 
15
15
  private
16
16
  def pwd
17
- Dir.pwd.split('/').last
17
+ @pwd ||= Dir.pwd.split('/').last
18
18
  end
19
19
 
20
20
  def process_hash
@@ -22,6 +22,6 @@ class CommonEventFormatter < Logger::Formatter
22
22
  end
23
23
 
24
24
  def hostname
25
- ENV["HOSTNAME"] || `hostname`
25
+ @hostname ||= ENV["HOSTNAME"] || `hostname`
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_event_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: