takihiro-simple_syslog_logger 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,11 +1,11 @@
1
1
  = simple_syslog_logger
2
2
 
3
- * http://github.com/takihiro/simple_syslog_logger/
4
-
5
- == Description
3
+ simple_syslog_logger is simple logging utility that bridge rails
4
+ and ruby syslog library.
6
5
 
7
6
  == Install
8
7
 
8
+ % [sudo] gem source -a http://gems.github.com # you only need to do once
9
9
  % [sudo] gem install takihiro-simple_syslog_logger
10
10
 
11
11
  == Usage
@@ -14,8 +14,11 @@ Add the following line to config/environment.rb:
14
14
 
15
15
  config.gem 'takihiro-simple_syslog_logger', :lib => 'simple_syslog_logger'
16
16
 
17
- and the following lines to config/environments/production.rb:
17
+ and the following lines to your config file:
18
+
19
+ config.logger = SimpleSyslogLogger.new(ident, options, facility)
20
+
21
+ == Link
18
22
 
19
- config.logger = SimpleSyslogLogger.new('ident', nil, Syslog::LOG_LOCAL1)
20
- config.logger.level = Syslog::LOG_ERR
23
+ http://github.com/takihiro/simple_syslog_logger/
21
24
 
@@ -3,7 +3,7 @@ require 'active_support'
3
3
 
4
4
  class SimpleSyslogLogger
5
5
 
6
- VERSION = '0.0.5'
6
+ VERSION = '0.0.7'
7
7
 
8
8
  DEFAULT_MAP = {
9
9
  :fatal => Syslog::LOG_ALERT,
@@ -26,7 +26,9 @@ class SimpleSyslogLogger
26
26
 
27
27
  def add(severity, message = nil, progname = nil, &block)
28
28
  message = (message || (block && block.call) || progname).to_s
29
- @syslog.log(severity, clean_message(message))
29
+ clean_message(message).split("\n").each do |line|
30
+ @syslog.log(severity, line)
31
+ end
30
32
  end
31
33
 
32
34
  def level=(level)
@@ -44,6 +44,12 @@ describe SimpleSyslogLogger do
44
44
  @logger.add(level, 'a % b % c')
45
45
  end
46
46
 
47
+ it 'should syslog called log method more than once when message include "\n"' do
48
+ @syslog_mock.should_receive(:log).exactly(7).times
49
+ @logger.add(Syslog::LOG_ERR, "1\n2")
50
+ @logger.add(Syslog::LOG_ERR, "1\n2\n3\n4\n5")
51
+ end
52
+
47
53
  end
48
54
 
49
55
  describe 'level' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takihiro-simple_syslog_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroaki Takisawa
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-20 00:00:00 -08:00
12
+ date: 2009-03-10 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,7 +22,7 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 2.0.0
24
24
  version:
25
- description: Simple logger output to syslogd for rails
25
+ description: simple_syslog_logger is simple logging utility that bridge rails logger and ruby syslog library.
26
26
  email: takky818@gmail.com
27
27
  executables: []
28
28
 
@@ -60,6 +60,6 @@ rubyforge_project:
60
60
  rubygems_version: 1.2.0
61
61
  signing_key:
62
62
  specification_version: 2
63
- summary: Simple logger output to syslogd for rails
63
+ summary: simple_syslog_logger is simple logging utility that bridge rails logger and ruby syslog library.
64
64
  test_files: []
65
65