mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-03-25 08:55:47 +00:00
using module name of Loggers rather than Logger
also explicit to_s on response body
This commit is contained in:
parent
82eab4cc91
commit
a05e018101
4 changed files with 8 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
module GrapeLogging
|
||||
module Logger
|
||||
module Loggers
|
||||
class Base
|
||||
def before
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module GrapeLogging
|
||||
module Logger
|
||||
class DatabaseTime < GrapeLogging::Logger::Base
|
||||
module Loggers
|
||||
class DatabaseTime < GrapeLogging::Loggers::Base
|
||||
def before
|
||||
@duration = 0
|
||||
ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module GrapeLogging
|
||||
module Logger
|
||||
class FilterParameters < GrapeLogging::Logger::Base
|
||||
module Loggers
|
||||
class FilterParameters < GrapeLogging::Loggers::Base
|
||||
def initialize(filter_parameters = nil, replacement = '[FILTERED]')
|
||||
@filter_parameters = filter_parameters || (defined?(Rails.application) ? Rails.application.config.filter_parameters : [])
|
||||
@replacement = replacement
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
module GrapeLogging
|
||||
module Logger
|
||||
class Response < GrapeLogging::Logger::Base
|
||||
module Loggers
|
||||
class Response < GrapeLogging::Loggers::Base
|
||||
def parameters(request, response)
|
||||
{
|
||||
response: response.body
|
||||
response: response.body.to_s
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue