Skip to content

Instantly share code, notes, and snippets.

@jsubida
Last active March 11, 2016 03:04
Show Gist options
  • Save jsubida/7050a9e77bb54ab6e11f to your computer and use it in GitHub Desktop.
Save jsubida/7050a9e77bb54ab6e11f to your computer and use it in GitHub Desktop.
require 'logger'
# Example code for Ruby's Logger module
# http://ruby-doc.org/stdlib-2.3.0/libdoc/logger/rdoc/Logger.html
log = Logger.new(STDOUT)
log.level = Logger::WARN
log.unknown("Unknown") # Always log
# Logger levels, where fatal is the most severe.
# No logs are output whose severity is below log.level.
# In this example, log.info and log.debug are not output.
log.fatal("Fatal")
log.error("Error")
log.warn("Warn")
log.info("Info")
log.debug("Debug")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment