5 changed files with 30 additions and 23 deletions
-
31app/controllers/welcome_controller.rb
-
2config/application.rb
-
6config/environments/development.rb
-
12config/environments/production.rb
-
2lib/formatters/basic_formatter.rb
@ -1,22 +1,23 @@ |
|||||
class WelcomeController < ApplicationController |
class WelcomeController < ApplicationController |
||||
def index |
def index |
||||
logger.measure_error "Took too long to complete", min_duration: 3000 do |
|
||||
logger.debug("Debugging information to aid with problem determination") |
|
||||
logger.info("Informational message such as request received\nline 2\nline3") |
|
||||
logger.warn("Warn about something in the system") |
|
||||
logger.error("An error occurred during processing") |
|
||||
logger.fatal("Oh no something really bad happened") |
|
||||
|
# logger.measure_error "Took too long to complete", min_duration: 3000 do |
||||
|
# logger.debug("Debugging information to aid with problem determination") |
||||
|
# logger.info("Informational message such as request received\nline 2\nline3") |
||||
|
# logger.warn("Warn about something in the system") |
||||
|
# logger.error("An error occurred during processing") |
||||
|
# logger.fatal("Oh no something really bad happened") |
||||
|
|
||||
logger.measure_info "Called external interface" do |
|
||||
sleep 0.1 # Code to call external service ... |
|
||||
end |
|
||||
|
# logger.measure_info "Called external interface" do |
||||
|
# sleep 0.1 # Code to call external service ... |
||||
|
# end |
||||
|
|
||||
SemanticLogger.tagged(user: "Jack", zip_code: 12345) do |
|
||||
# All log entries in this block will include the above named tags |
|
||||
logger.debug("Hello World") |
|
||||
end |
|
||||
|
# SemanticLogger.tagged(user: "Jack", zip_code: 12345) do |
||||
|
# # All log entries in this block will include the above named tags |
||||
|
# logger.debug("Hello World") |
||||
|
# end |
||||
|
|
||||
# raise "exception" |
|
||||
end |
|
||||
|
logger.info("efficient logging in practice works better on dark theme") |
||||
|
# raise "exception" |
||||
|
# end |
||||
end |
end |
||||
end |
end |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue