Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created July 9, 2012 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchrisadams/3077696 to your computer and use it in GitHub Desktop.
Save mrchrisadams/3077696 to your computer and use it in GitHub Desktop.
def with_logging(description)
begin
@logger.debug( "Starting #{description}" )
yield
@logger.debug( "Completed #{description}" )
rescue
@logger.error( "#{description} failed!!")
raise
end
end
# surely this…
with_logging 'identify' do
KM.identify(current_user.email)
end
# is the same as this, right? …
with_logging 'identify' { KM.identify(current_user.email) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment