Last active
December 24, 2015 16:59
-
-
Save leosoto/6832677 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| def logger | |
| if Application.production? | |
| $logfile | |
| elsif Application.development? | |
| $stdout | |
| end | |
| end | |
| def important_activity | |
| do_important_thing or logger.puts('Warning: important thing was unsuccessful.') | |
| rescue StandardError => e | |
| logger.puts("Exception: important thing raised an exception. Error: #{e.message}") | |
| raise if $reraise_exceptions | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment