Permalink
Browse files

Added an example with error logging to README

  • Loading branch information...
1 parent 2ef6fa6 commit 8582f9bbe70ddcea3b23dd17e926e34e6bed14e3 @gshutler committed Nov 4, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 README.md
View
@@ -48,6 +48,16 @@ class Foo
def work
log.info { 'Doing some work' }
end
+
+ def dangerous_work
+ log.info { 'Attempting dangerous work' }
+ attempt_dangerous_work
+ log.info { 'Dangerous work complete' }
+ true
+ rescue => e
+ log.error "Dangerous work failed - #{e.message}", e
+ false
+ end
end
```

0 comments on commit 8582f9b

Please sign in to comment.