Skip to content

Loading…

[DO NOT MERGE] Commits missing #2

Closed
wants to merge 9 commits into from

3 participants

@chancancode

As I mentioned in seattlerb/sysloglogger#5, the following commits seems to be lost from your fork and the original seattlerb repo:

8a68c88 Set release date (Eric Hodel, 9 months ago)
76f80ae Remove seattlerb plugin (Eric Hodel, 9 months ago)
dd32069 Add git plugin (Eric Hodel, 9 months ago)
9c49781 Update README for Hoe (Eric Hodel, 9 months ago)
ae13d91 Added .travis.yml (Eric Hodel, 9 months ago)
4a0a5e1 Added documentation for generated logger methods (Eric Hodel, 9 months ago)
2b2d9be Ignore vim swp files and the pkg and doc directories (Eric Hodel, 9 months ago)
e2efe34 Merge pull request #3 from methodmissing/master (Eric Hodel, 9 months ago)
9d2f0a7 Do not clean messages twice in SyslogLogger#add (Lourens Naudé, 11 months ago)

I have them preserved in my master branch.

@chancancode chancancode referenced this pull request in seattlerb/sysloglogger
Closed

Fixed incompatibility with stock logger when using blocks #5

@chancancode

Double checked with Aaron during RailsConf and it seems like we are fine. Moving this to a lost_commits branch on my fork in case anyone needs these later.

@chancancode chancancode closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 5, 2012
  1. @methodmissing
Commits on Mar 22, 2012
  1. @drbrain

    Merge pull request #3 from methodmissing/master

    drbrain committed
    Do not clean messages twice in SyslogLogger#add
  2. @drbrain
  3. @drbrain
  4. @drbrain

    Added .travis.yml

    drbrain committed
  5. @drbrain

    Update README for Hoe

    drbrain committed
  6. @drbrain

    Add git plugin

    drbrain committed
  7. @drbrain

    Remove seattlerb plugin

    drbrain committed
  8. @drbrain

    Set release date

    drbrain committed
Showing with 117 additions and 13 deletions.
  1. +3 −0 .gitignore
  2. +15 −0 .travis.yml
  3. +6 −0 History.txt
  4. +46 −7 README.txt
  5. +4 −3 Rakefile
  6. +43 −3 lib/syslog_logger.rb
View
3 .gitignore
@@ -0,0 +1,3 @@
+*.swp
+/doc
+/pkg
View
15 .travis.yml
@@ -0,0 +1,15 @@
+---
+after_script:
+- rake travis:after -t
+before_script:
+- gem install hoe-travis --no-rdoc --no-ri
+- rake travis:before -t
+language: ruby
+notifications:
+ email:
+ - drbrain@segment7.net
+rvm:
+- 1.8.7
+- 1.9.2
+- 1.9.3
+script: rake travis
View
6 History.txt
@@ -1,3 +1,9 @@
+== 1.4.1 / 2012-03-22
+
+* Bug fixes
+ * Messages for syslog() are no longer cleaned twice. Pull Request #3 by
+ Lourens Naudé
+
== 1.4.0 / 2007-05-08
* Split from rails_analyzer_tools.
View
53 README.txt
@@ -1,17 +1,56 @@
= SyslogLogger
+Documentation :: http://docs.seattlerb.org/SyslogLogger
+Source :: https://github.com/seattlerb/sysloglogger
+Bugtracker :: https://github.com/seattlerb/sysloglogger/issues
+
+== DESCRIPTION
+
SyslogLogger is a Logger replacement that logs to syslog. It is almost
-drop-in with a few caveats.
+drop-in with a few differences.
+
+== FEATURES
+
+* Works like Logger
+* Logs to syslog(3) mapping Logger levels to syslog(3) levels
+
+== SYNOPSIS
+
+ require 'syslog_logger'
+
+ logger = SyslogLogger.new 'your_application_name'
+
+ logger.info 'did something cool'
+
+== INSTALL
+
+ gem install SyslogLogger
+
+You may need to configure your syslog.conf to place application logs in a
+particular file. See SyslogLogger for details.
-http://seattlerb.rubyforge.org/SyslogLogger
+== LICENSE
-http://rubyforge.org/projects/seattlerb
+(The MIT License)
-== About
+Copyright (c) Eric Hodel
-See SyslogLogger
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
-== Install
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
- sudo gem install SyslogLogger
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
7 Rakefile
@@ -1,14 +1,15 @@
# -*- ruby -*-
require 'hoe'
-require './lib/syslog_logger.rb'
-Hoe.plugin :seattlerb
+Hoe.plugin :travis
+Hoe.plugin :git
Hoe.spec 'SyslogLogger' do
developer 'Eric Hodel', 'drbrain@segment7.net'
- self.rubyforge_name = 'seattlerb'
+ rdoc_locations <<
+ 'docs.seattlerb.org:/data/www/docs.seattlerb.org/SyslogLogger'
end
# vim: syntax=Ruby
View
46 lib/syslog_logger.rb
@@ -77,10 +77,15 @@ class SyslogLogger
##
# The version of SyslogLogger you are using.
- VERSION = '1.4.0'
+ VERSION = '1.4.1'
##
# Maps Logger warning types to syslog(3) warning types.
+ #
+ # Messages from ruby applications are not considered as critical as messages
+ # from other processes using syslog(3), so most messages are reduced by one
+ # level. For example, a fatal message for ruby's Logger is considered an
+ # error for syslog(3).
LOGGER_MAP = {
:unknown => :alert,
@@ -126,6 +131,42 @@ def #{meth}?
EOM
end
+ ##
+ # :method: unknown
+ #
+ # Logs a +message+ at the unknown (syslog alert) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: fatal
+ #
+ # Logs a +message+ at the fatal (syslog err) log level, or logs the message
+ # returned from the block.
+
+ ##
+ # :method: error
+ #
+ # Logs a +message+ at the error (syslog warning) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: warn
+ #
+ # Logs a +message+ at the warn (syslog notice) log level, or logs the
+ # message returned from the block.
+
+ ##
+ # :method: info
+ #
+ # Logs a +message+ at the info (syslog info) log level, or logs the message
+ # returned from the block.
+
+ ##
+ # :method: debug
+ #
+ # Logs a +message+ at the debug (syslog debug) log level, or logs the
+ # message returned from the block.
+
LOGGER_MAP.each_key do |level|
make_methods level
end
@@ -155,8 +196,7 @@ def initialize(program_name = 'rails')
def add(severity, message = nil, progname = nil, &block)
severity ||= Logger::UNKNOWN
return true if severity < @level
- message = clean(message || block.call)
- SYSLOG.send LEVEL_LOGGER_MAP[severity], clean(message)
+ SYSLOG.send LEVEL_LOGGER_MAP[severity], clean(message || block.call)
return true
end
Something went wrong with that request. Please try again.