syslogger 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -51,4 +51,4 @@ See <https://github.com/crohr/syslogger/contributors>.
51
51
 
52
52
  == Copyright
53
53
 
54
- Copyright (c) 2010 Cyril, INRIA Rennes-Bretagne Atlantique. See LICENSE for details.
54
+ Copyright (c) 2010 Cyril Rohr, INRIA Rennes-Bretagne Atlantique. See LICENSE for details.
data/lib/syslogger.rb CHANGED
@@ -4,7 +4,7 @@ require 'thread'
4
4
 
5
5
  class Syslogger
6
6
 
7
- VERSION = "1.4.0"
7
+ VERSION = "1.4.1"
8
8
 
9
9
  attr_reader :level, :ident, :options, :facility
10
10
 
@@ -105,6 +105,11 @@ class Syslogger
105
105
  @level = level
106
106
  end
107
107
 
108
+ # Sets the ident string passed along to Syslog
109
+ def ident=(ident)
110
+ @ident = ident
111
+ end
112
+
108
113
  protected
109
114
 
110
115
  # Borrowed from SyslogLogger.
@@ -175,6 +175,19 @@ describe "Syslogger" do
175
175
  end
176
176
  end # describe "level="
177
177
 
178
+ describe "ident=" do
179
+ before(:each) do
180
+ @logger = Syslogger.new("my_app", Syslog::LOG_PID | Syslog::LOG_CONS, nil)
181
+ end
182
+
183
+ it "should permanently change the ident string" do
184
+ @logger.ident = "new_ident"
185
+ Syslog.should_receive(:open).with("new_ident", Syslog::LOG_PID | Syslog::LOG_CONS, nil).and_yield(syslog=mock("syslog", :mask= => true))
186
+ syslog.should_receive(:log)
187
+ @logger.warn("should get the new ident string")
188
+ end
189
+ end
190
+
178
191
  describe ":level? methods" do
179
192
  before(:each) do
180
193
  @logger = Syslogger.new("my_app", Syslog::LOG_PID, Syslog::LOG_USER)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syslogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-20 00:00:00.000000000 Z
12
+ date: 2012-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake