Permalink
Browse files

Updated the documentation for passing errors and added release notes

  • Loading branch information...
1 parent e8834a4 commit 2ef6fa6b5f208413a7f82595954bd2561ca524cf @gshutler committed Nov 4, 2012
Showing with 34 additions and 6 deletions.
  1. +9 −2 README.md
  2. +12 −0 RELEASE.md
  3. +2 −2 hatchet.gemspec
  4. +11 −2 lib/hatchet/hatchet_logger.rb
View
@@ -55,10 +55,14 @@ end
```ruby
module Bar
- extend Hatchet
+ include Hatchet
def self.work
- log.info { 'Doing some work' }
+ log.info { 'Doing some module work' }
+ end
+
+ def work
+ log.info { 'Doing some mixin work' }
end
end
```
@@ -91,6 +95,9 @@ where appropriate:
register Hatchet
```
+Note that you may have to use the `log` alias as Sinatra already has a `logger`
+method.
+
#### Rails
Hatchet includes a Railtie that is loaded automatically and wraps the
View
@@ -0,0 +1,12 @@
+# Release notes
+
+## 0.0.17
+
+ * Added the ability to pass an error along with your message
+
+### Bug fixes
+
+ * Fixed the fallback logging if an appender raises an error whilst trying to
+ log a message
+ * Ensured all logging calls truly do return `nil` rather than it just being
+ part of the documented contract
View
@@ -6,9 +6,9 @@ Gem::Specification.new do |gem|
gem.email = ["garry@robustsoftware.co.uk"]
gem.description = %q{Logging library that provides the ability to add class/module specific filters}
gem.summary = %q{Logging library that provides the ability to add class/module specific filters}
- gem.homepage = "https://github.com/gshutler/hatchet"
+ gem.homepage = "http://gshutler.github.com/hatchet/"
- gem.files = Dir['{lib,spec}/**/*'] + %w{LICENSE}
+ gem.files = Dir['{lib,spec}/**/*'] + %w{LICENSE README.md RELEASE.md}
gem.test_files = Dir['spec/**/*']
gem.name = "hatchet"
gem.require_paths = ["lib"]
@@ -20,8 +20,17 @@ module Hatchet
#
# Examples
#
- # logger.info "Informational message"
- # logger.info { "Informational message #{potentially_expensive}" }
+ # log.info "Informational message"
+ # log.info { "Informational message #{potentially_expensive}" }
+ #
+ # It is also possible to pass an error to associate with a message. It is down
+ # to the appender what it will do with the error (such as including the stack
+ # trace) so it is recommended you still include basic information within the
+ # message you pass.
+ #
+ # Examples
+ #
+ # log.error "Something bad happened - #{error.message}", error
#
# Log messages are sent to each appender where they will be filtered and
# invoked as configured.

0 comments on commit 2ef6fa6

Please sign in to comment.