cbrunnkvist-psd_logger 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cbrunnkvist-psd_logger}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Conny Brunnkvist"]
data/lib/psd_logger.rb CHANGED
@@ -14,9 +14,6 @@ require 'logger'
14
14
  # RAILS_DEFAULT_LOGGER = PsdLogger.new
15
15
 
16
16
  class PsdLogger
17
- ##
18
- # The version of SyslogLogger you are using.
19
- VERSION = '0.0.1'
20
17
  # From 'man syslog.h':
21
18
  # LOG_EMERG A panic condition was reported to all processes.
22
19
  # LOG_ALERT A condition that should be corrected immediately.
@@ -103,6 +100,9 @@ include Logger::Severity
103
100
  prepend = progname ? "[#{progname}] " : nil
104
101
  prepend ||= @filter ? "[#{@filter}] " : ''
105
102
  message = clean(message || block.call)
103
+ if defined?(Rails)
104
+ message = "#{Rails.env}/#{Rails.root.split.last} #{message}"
105
+ end
106
106
  SYSLOG.send LEVEL_LOGGER_MAP[severity], prepend + clean(message)
107
107
  end
108
108
  true
@@ -133,9 +133,6 @@ include Logger::Severity
133
133
  message.strip!
134
134
  message.gsub!(/%/, '%%') # syslog(3) freaks on % (printf)
135
135
  message.gsub!(/\e\[[^m]*m/, '') # remove useless ansi color codes
136
- if defined?(Rails)
137
- message = "#{Rails.env}/#{Rails.root.split.last} #{message}"
138
- end
139
136
  return message
140
137
  end
141
138
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cbrunnkvist-psd_logger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Conny Brunnkvist