FEATURE: logster env tab, log current user

This commit is contained in:
Sam 2014-05-12 15:27:58 +10:00
parent 8f788b339b
commit f8b7f0d73f
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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