lib/hanami/logger.rb in hanami-utils-1.3.5 vs lib/hanami/logger.rb in hanami-utils-1.3.6

- old
+ new

@@ -5,20 +5,20 @@ require "hanami/utils/files" module Hanami # Hanami logger # - # Implement with the same interface of Ruby std lib `Logger`. + # Implementation with the same interface of Ruby std lib `Logger`. # It uses `STDOUT`, `STDERR`, file name or open file as output stream. # # # When a Hanami application is initialized, it creates a logger for that specific application. # For instance for a `Bookshelf::Application` a `Bookshelf::Logger` will be available. # # This is useful for auto-tagging the output. Eg (`app=Booshelf`). # - # When used stand alone (eg. `Hanami::Logger.info`), it tags lines with `app=Shared`. + # When used standalone (eg. `Hanami::Logger.info`), it tags lines with `app=Shared`. # # # The available severity levels are the same of `Logger`: # # * DEBUG @@ -28,11 +28,11 @@ # * FATAL # * UNKNOWN # # Those levels are available both as class and instance methods. # - # Also Hanami::Logger support different formatters. Now available only two: + # Also Hanami::Logger supports different formatters. Now available only two: # # * Formatter (default) # * JSONFormatter # # And if you want to use custom formatter you need create new class inherited from @@ -277,11 +277,11 @@ # # logger = Hanami::Logger.new(formatter: :json) # logger.info "Hello World" # # # => {"app":"Hanami","severity":"DEBUG","time":"2017-03-30T13:57:59Z","message":"Hello World"} - # rubocop:disable Lint/HandleExceptions + # rubocop:disable Lint/SuppressedException # rubocop:disable Metrics/ParameterLists def initialize(application_name = nil, *args, stream: $stdout, level: DEBUG, formatter: nil, filter: [], colorizer: nil) begin Utils::Files.mkdir_p(stream) rescue TypeError @@ -294,11 +294,11 @@ @application_name = application_name @formatter = Formatter.fabricate(formatter, self.application_name, filter, lookup_colorizer(colorizer)) end # rubocop:enable Metrics/ParameterLists - # rubocop:enable Lint/HandleExceptions + # rubocop:enable Lint/SuppressedException # Returns the current application name, this is used for tagging purposes # # @return [String] the application name # @@ -311,10 +311,10 @@ # @api private def level=(value) super _level(value) end - # Close the logging stream if this stream isn't an STDOUT + # Closes the logging stream if this stream isn't an STDOUT # # @since 0.8.0 def close super unless [STDOUT, $stdout].include?(@stream) end