diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 09705d1..dfd83fa 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,2 +1,7 @@ class ApplicationController < ActionController::Base + around_action do |_, action| + logger.measure_error "Took too long to complete, please review your code as asynchronous task", min_duration: 3000 do + action.call + end + end end diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb new file mode 100644 index 0000000..2fecb2c --- /dev/null +++ b/app/controllers/main_controller.rb @@ -0,0 +1,12 @@ +class MainController < ApplicationController + def home + end + + def about + logger.debug "some debugging info" + logger.info "efficient logging for dark theme" + logger.warn "a warning" + logger.error "an error" + sleep 3 + end +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb deleted file mode 100644 index 5fdd389..0000000 --- a/app/controllers/welcome_controller.rb +++ /dev/null @@ -1,23 +0,0 @@ -class WelcomeController < ApplicationController - 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_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 - - logger.info("efficient logging for dark theme") - # raise "exception" - # end - end -end diff --git a/app/helpers/main_helper.rb b/app/helpers/main_helper.rb new file mode 100644 index 0000000..826effe --- /dev/null +++ b/app/helpers/main_helper.rb @@ -0,0 +1,2 @@ +module MainHelper +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 66edd15..546de3f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,6 +9,10 @@ <%= javascript_importmap_tags %>
+ <%= yield %>