Skip to content

Instantly share code, notes, and snippets.

@sephraim
Created October 17, 2022 22:41
Show Gist options
  • Save sephraim/ca5b9a49d66353afaab9337c4030f3bc to your computer and use it in GitHub Desktop.
Save sephraim/ca5b9a49d66353afaab9337c4030f3bc to your computer and use it in GitHub Desktop.
[Create an anonymous class]
# Initialize
#
# @return [void]
def initialize
# Setup a simple logger for running locally (if full $logger not available)
$logger ||= Class.new do
# Print info message
#
# @param msg [String] Message to print
# @return [void]
def info(msg)
puts "INFO: #{msg}"
end
# Print warning message
#
# @param msg [String] Message to print
# @return [void]
def warn(msg)
puts "WARN: #{msg}"
end
end.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment