From f8b7f0d73fa84d0918a64247f23f892388436b05 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 12 May 2014 15:27:58 +1000 Subject: [PATCH] FEATURE: logster env tab, log current user --- Gemfile.lock | 2 +- app/controllers/application_controller.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 90d8b3d64..2713400e7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -152,7 +152,7 @@ GEM thor (~> 0.15) libv8 (3.16.14.3) listen (0.7.3) - logster (0.0.4) + logster (0.0.5) lru_redux (0.8.1) mail (2.5.4) mime-types (~> 1.16) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7fa94a656..76b4d2bdf 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -28,6 +28,7 @@ class ApplicationController < ActionController::Base end end + before_filter :set_current_user_for_logs before_filter :set_locale before_filter :set_mobile_view before_filter :inject_preview_style @@ -120,6 +121,12 @@ class ApplicationController < ActionController::Base end end + def set_current_user_for_logs + if current_user + Logster.add_to_env(request.env,"username",current_user.username) + end + end + def set_locale I18n.locale = if SiteSetting.allow_user_locale && current_user && current_user.locale.present? current_user.locale