mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
18 lines
699 B
Ruby
18 lines
699 B
Ruby
# Copyright (c) 2010 Michael Dvorkin
|
|
#
|
|
# Awesome Print is freely distributable under the terms of MIT license.
|
|
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
|
|
#------------------------------------------------------------------------------
|
|
module AwesomePrintLogger
|
|
|
|
# Add ap method to logger
|
|
#------------------------------------------------------------------------------
|
|
def ap(object, level = nil)
|
|
level ||= AwesomePrint.defaults[:log_level] || :debug
|
|
send level, object.ai
|
|
end
|
|
|
|
end
|
|
|
|
Logger.send(:include, AwesomePrintLogger) if defined?(Logger)
|
|
ActiveSupport::BufferedLogger.send(:include, AwesomePrintLogger) if defined?(::ActiveSupport::BufferedLogger)
|