Skip to content

Instantly share code, notes, and snippets.

@KushalP
Created March 9, 2012 12:40
Show Gist options
  • Save KushalP/2d32eee3f45840ab5a27 to your computer and use it in GitHub Desktop.
Save KushalP/2d32eee3f45840ab5a27 to your computer and use it in GitHub Desktop.
Is there any way I can get around needing 'include Logging' for all classes that I want to expose my Logging module to?
module MyModule
module Logging
def logger
Logging.logger
end
def self.logger
@logger ||= Logger.new(STDOUT)
end
end
end
module MyModule
class Test
incude Logging
def some_method
do_something_here()
logger.debug "done something!"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment