Last active
October 29, 2018 14:54
-
-
Save Al-un/581ee90fcd54db88301d1bb9dbcc1334 to your computer and use it in GitHub Desktop.
Testing tagged logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# controllers/catalogs_controller.rb | |
def show | |
@catalog = Catalog.includes(article_publications: [:article]).find(params[:id]) | |
logger.debug "Debugging: showing catalogs #{@catalog.id}" | |
logger.info "Info: showing catalogs #{@catalog.id}" | |
logger.warn "Warn: showing catalogs #{@catalog.id}" | |
# add some tagged logs here | |
logger.tagged("Catalogs show") { logger.debug "Moar stuff" } | |
logger.tagged("Catalogs show") { logger.info "Stuff" } | |
logger.tagged("Catalogs show") { logger.tagged("Nested tag") { logger.info "Stuff" } } | |
# .... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment