Sha256: 792c141bd2bf161021eeb2682abed8def480d57a02a807ff21fa675c3c343e3a

Contents?: true

Size: 993 Bytes

Versions: 7

Compression:

Stored size: 993 Bytes

Contents

require 'logger'

class YouTubeG
  
  # TODO: Why is this needed? Does this happen if running standalone w/o Rails?
  # Anyway, isn't it easier to debug w/o the really long timestamp & log level?
  # How often do you look at the timestamp and log level? Wouldn't it be nice to
  # see your logger output first?
  
  # Extension of the base ruby Logger class to restore the default log
  # level and timestamp formatting which is so rudely taken forcibly
  # away from us by the Rails app's use of the ActiveSupport library
  # that wholesale-ly modifies the Logger's format_message method.
  #
  class Logger < ::Logger
    private
      begin
        # restore original log formatting to un-screw the screwage that is
        # foisted upon us by the activesupport library's clean_logger.rb
        alias format_message old_format_message

      rescue NameError
        # nothing for now -- this means we didn't need to alias since the
        # method wasn't overridden
      end
  end
end

Version data entries

7 entries across 7 versions & 4 rubygems

Version Path
FiXato-youtube-g-0.4.5 lib/youtube_g/logger.rb
msp-youtube-g-0.4.5 lib/youtube_g/logger.rb
msp-youtube-g-0.4.6 lib/youtube_g/logger.rb
msp-youtube-g-0.4.7 lib/youtube_g/logger.rb
tmm1-youtube-g-0.4.5 lib/youtube_g/logger.rb
youtube-g-0.4.0 lib/youtube_g/logger.rb
youtube-g-0.4.1 lib/youtube_g/logger.rb