Navigation Menu

Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dolzenko committed Sep 3, 2010
0 parents commit ff11f94
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 0 deletions.
20 changes: 20 additions & 0 deletions MIT-LICENSE
@@ -0,0 +1,20 @@
Copyright (c) 2008 [name of plugin creator]

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 9 additions & 0 deletions README
@@ -0,0 +1,9 @@
SilentPostgres
==============

Silences internal diagnostic messages from postgresql connection adapter.

Enabled only in development and test environments, skips production for
performance reasons - logging is probably disabled there anyway.

Copyright (c) 2008 Łukasz Piestrzeniewicz, released under the MIT license
5 changes: 5 additions & 0 deletions init.rb
@@ -0,0 +1,5 @@
if %w(test development).include?(ENV["RAILS_ENV"])
puts "Silencing Postgres"
require 'silent_postgres'
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, SilentPostgres)
end
11 changes: 11 additions & 0 deletions lib/.svn/all-wcprops
@@ -0,0 +1,11 @@
K 25
svn:wc:ra_dav:version-url
V 41
/svn/!svn/ver/3/trunk/silent_postgres/lib
END
silent_postgres.rb
K 25
svn:wc:ra_dav:version-url
V 60
/svn/!svn/ver/3/trunk/silent_postgres/lib/silent_postgres.rb
END
62 changes: 62 additions & 0 deletions lib/.svn/entries
@@ -0,0 +1,62 @@
10

dir
3
http://silent-postgres.googlecode.com/svn/trunk/silent_postgres/lib
http://silent-postgres.googlecode.com/svn



2008-03-14T14:52:31.102621Z
3
bragi.ragnarson














af053fb6-6648-0410-933e-cf740565ad39

silent_postgres.rb
file




2010-09-03T11:25:36.000000Z
6f4fa5a46a0b65a32a942bfbc089b505
2008-03-14T14:46:41.921379Z
2
bragi.ragnarson





















433

19 changes: 19 additions & 0 deletions lib/.svn/text-base/silent_postgres.rb.svn-base
@@ -0,0 +1,19 @@
module SilentPostgres
SILENCED_METHODS = %w(tables indexes column_definitions pk_and_sequence_for last_insert_id)

def self.included(base)
SILENCED_METHODS.each do |m|
base.send :alias_method_chain, m, :silencer
end
end

SILENCED_METHODS.each do |m|
eval <<METHOD
def #{m}_with_silencer(*args)
@logger.silence do
#{m}_without_silencer(*args)
end
end
METHOD
end
end
19 changes: 19 additions & 0 deletions lib/silent_postgres.rb
@@ -0,0 +1,19 @@
module SilentPostgres
SILENCED_METHODS = %w(tables indexes column_definitions pk_and_sequence_for last_insert_id)

def self.included(base)
SILENCED_METHODS.each do |m|
base.send :alias_method_chain, m, :silencer
end
end

SILENCED_METHODS.each do |m|
eval <<METHOD
def #{m}_with_silencer(*args)
@logger.silence do
#{m}_without_silencer(*args)
end
end
METHOD
end
end

0 comments on commit ff11f94

Please sign in to comment.