Application logger
This commit is contained in:
parent
4903910390
commit
0523b4265b
10 changed files with 86 additions and 20 deletions
|
@ -6,3 +6,7 @@ $ ->
|
|||
elems.val('').attr 'disabled', true
|
||||
else
|
||||
elems.removeAttr 'disabled'
|
||||
|
||||
$('.log-tabs a').click (e) ->
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//= require jquery.endless-scroll
|
||||
//= require jquery.highlight
|
||||
//= require jquery.waitforimages
|
||||
//= require bootstrap-modal
|
||||
//= require bootstrap
|
||||
//= require modernizr
|
||||
//= require chosen-jquery
|
||||
//= require raphael
|
||||
|
|
|
@ -55,7 +55,6 @@ ul.main_menu {
|
|||
|
||||
&.current {
|
||||
background-color:#D5D5D5;
|
||||
border-bottom: 1px solid #AAA;
|
||||
border-right: 1px solid #BBB;
|
||||
border-left: 1px solid #BBB;
|
||||
border-radius: 0 0 1px 1px;
|
||||
|
|
|
@ -4,6 +4,18 @@ class ProjectObserver < ActiveRecord::Observer
|
|||
end
|
||||
|
||||
def after_destroy(project)
|
||||
log_info("Project \"#{project.name}\" was removed")
|
||||
|
||||
project.destroy_repository
|
||||
end
|
||||
|
||||
def after_create project
|
||||
log_info("#{project.owner.name} created a new project \"#{project.name}\"")
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def log_info message
|
||||
Gitlab::AppLogger.info message
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
class UserObserver < ActiveRecord::Observer
|
||||
def after_create(user)
|
||||
log_info("User \"#{user.name}\" (#{user.email}) was created")
|
||||
|
||||
Notify.new_user_email(user.id, user.password).deliver
|
||||
end
|
||||
|
||||
def after_destroy user
|
||||
log_info("User \"#{user.name}\" (#{user.email}) was removed")
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def log_info message
|
||||
Gitlab::AppLogger.info message
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,9 +1,26 @@
|
|||
.file_holder#README
|
||||
.file_title
|
||||
%i.icon-file
|
||||
githost.log
|
||||
.file_content.logs
|
||||
%ol
|
||||
- Gitlab::Logger.read_latest.each do |line|
|
||||
%li
|
||||
%p= line
|
||||
%ul.nav.nav-tabs.log-tabs
|
||||
%li.active
|
||||
= link_to "githost.log", "#githost", 'data-toggle' => 'tab'
|
||||
%li
|
||||
= link_to "application.log", "#application", 'data-toggle' => 'tab'
|
||||
.tab-content
|
||||
.tab-pane.active#githost
|
||||
.file_holder#README
|
||||
.file_title
|
||||
%i.icon-file
|
||||
githost.log
|
||||
.file_content.logs
|
||||
%ol
|
||||
- Gitlab::GitLogger.read_latest.each do |line|
|
||||
%li
|
||||
%p= line
|
||||
.tab-pane#application
|
||||
.file_holder#README
|
||||
.file_title
|
||||
%i.icon-file
|
||||
application.log
|
||||
.file_content.logs
|
||||
%ol
|
||||
- Gitlab::AppLogger.read_latest.each do |line|
|
||||
%li
|
||||
%p= line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue