Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created October 5, 2011 19:50
Show Gist options
  • Select an option

  • Save practicingruby/1265491 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/1265491 to your computer and use it in GitHub Desktop.
singleton Logger
def output
@output ||= STDOUT
end
attr_writer :output
def log(text)
output.puts(text)
end
end
Logger.log("My text")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment